Update Occupant Features (Indoors)

Available with the ArcGIS Indoors Pro or ArcGIS Indoors Maps extension.

Summary

Updates the Occupants feature class that conforms to the ArcGIS Indoors Information Model.

This tool updates the Occupants feature class created using the Create Indoors Database tool. Updating occupant features may be necessary when new occupants need to be added, existing occupants need to be deleted, or existing occupant information needs to be modified based on changes to seating assignments or floor plans. The updated Occupants feature class can be used to support indoor analysis and functionality—such as searching, routing, and workspace reservations in Indoor Viewer and Indoors Mobile—and space planning in Indoor Space Planner.

Usage

  • The input occupant table must include the KNOWNAS and EMAIL fields. You can also include the following fields to enhance the Space Planner app experience or additional fields that include information you want to be populated and maintained in the Occupants feature class: ORG_LEVEL_1, ORG_LEVEL_2, JOB_TITLE, START_DATE, and SITE_ID.

    You can store multiple assignments for occupants in multiple columns in the input occupant table. The following is an example of an assignment with multiple columns:

    Table with multiple assignment columns

    The table below lists the required and optional fields for the input occupant table.

    Note:

    The SITE_ID field will only be populated if you map the SITE_ID field in the field mapping control of the tool. If this field is not mapped, the Occupant SITE_ID field value will remain NULL.

    FieldDescriptionIs nullable
    KNOWNAS

    The first and last name most likely to be used when searching for an occupant.

    No

    EMAIL

    The occupant's email address.

    No

    ORG_LEVEL_1

    The first level of the organization.

    Yes

    ORG_LEVEL_2

    The second level of the organization.

    Yes

    JOB_TITLE

    The occupant's job title.

    Yes

    START_DATE

    The occupant's start date.

    Yes

    SITE_ID

    The occupant's associated site. Values in this field must match those in the SITE_ID field in the Sites feature class from the Indoors model.

    Yes

    Learn more about loading occupant data

  • The tool supports loading occupants that are not assigned to a space. If the field identified in the Unit Identifier (Input Occupant Table) parameter has a NULL or empty value, the occupant will be loaded as unassigned (they will not be assigned to a unit). Occupants assigned to units in the input occupant table that are defined as hotels, hot desks, or not assignable units in the Units feature class will also be loaded as unassigned.

    Note:

    If the Occupant Unit Identifier Field parameter is empty (for a .csv file or an Excel sheet) or <NULL> (for a geodatabase table), the occupant will be loaded as unassigned.

  • Occupant information is added, deleted, and modified based on the unique occupant identifier field value.

    Note:

    The occupant identifier can be any field that contains information to uniquely identify each occupant. The recommended field is EMAIL.

  • The Target Occupant Features parameter value will have the following fields populated with corresponding values from the Input Occupant Table parameter value based on seating assignment changes or floor plan changes:

    • UNIT_ID
    • UNIT_NAME (If it exists in the Target Occupant Features parameter value.)
    • LEVEL_ID
    • SITE_ID (It can be mapped with values from the input occupant table in the Occupant Attributes Mapping parameter.)
    Note:

    If the Unit Identifier (Input Occupant Table) parameter value is not provided, only fields mapped in the Occupant Attributes Mapping parameter will be updated.

  • The Units feature class's ASSIGNMENT_TYPE value that is used by Space Planner will be updated to display the occupancy status of the unit. If an occupant feature is assigned to a unit, that unit's ASSIGNMENT_TYPE value is set to Office.

  • If an update is made to the floor plan data using a tool that affects unit features with assigned occupants, such as Import Floorplans to Indoors Geodatabase or Import BIM to Indoor Dataset, the following occurs when the tool is run:

    • If a unit no longer exists after a floor plan update, any occupants that are assigned to that unit will be unassigned.
    • If a unit's ASSIGNMENT_TYPE field value has changed to Not Assignable after a floor plan update, any occupants assigned to the unit will be unassigned.
    • If an occupant feature is no longer located within the unit to which they are assigned after a floor plan update, the occupant feature will be moved back to the assigned unit centroid.
    Note:

    Updating occupant data to align with an updated floor plan does not require an input to the Input Occupant Table parameter.

  • You can run the tool periodically to update occupant data and change seating assignments or floor plans. You can also publish the tool as a geoprocessing service and run the tool using Microsoft Scheduler or CRON.

  • This tool creates a summary text file in the temp directory that is valid in the ArcGIS Pro session. To maintain a permanent record of the summary text file, you must save it in a folder outside the ArcGIS Pro session.

Parameters

LabelExplanationData Type
Target Occupant Features

The target feature layer, feature class, or feature service to which occupant records will be added, updated, or deleted. The input must contain unique values that identify each occupant and must conform to the Occupants feature class in the Indoors model.

Feature Layer
Input Unit Features
(Optional)

The input polygon features representing building spaces that may be occupied. The input must be a feature layer, feature class, or feature service that conforms to the Units feature class in the Indoors model. The centroid of each space will be used as the point location of the occupant or occupants.

Feature Layer
Input Occupant Table
(Optional)

The input table that contains information about building occupants.

The input table must be a geodatabase table, a sheet in a Microsoft Excel workbook (.xls or .xlsx file), a comma-delimited text file (.csv), or an OLE DB table.

Table View
Occupant Identifier (Target Occupant Features)
(Optional)

The field in the Target Occupant Features parameter value that will be used as the primary key to associate occupants with the Input Occupant Table parameter values. The field values must be unique.

Field
Occupant Identifier (Input Occupant Table)
(Optional)

The field in the Input Occupant Table parameter value that will be used as the primary key to associate occupants with the Target Occupant Features parameter values. The field values must be unique.

Field
Unit Identifier (Input Units Features)
(Optional)

The field in the Input Unit Features parameter value that stores the unique space identification information that will match the unit identifier from the Input Occupant Table parameter value. The field values must be unique.

Field
Unit Identifier (Input Occupant Table)
(Optional)

The field or fields in the Input Occupant Table parameter value that will be used as the primary key to associate occupant space assignment with the Input Unit Features parameter values. If a field value is empty, the occupant will be loaded as unassigned.

This parameter supports multiple fields from an input occupant table that stores more than one space assignment of an occupant. Only the fields provided will be used to update the Occupants feature class.

If no parameter value is provided, the occupant's seating assignments will not be updated in the Occupants feature class. Instead, the records in the Occupants feature class will be matched to records in the input occupant table and attributes mapped in the Occupant Attributes Mapping parameter will be updated.

Field
Occupant Attributes Mapping
(Optional)

The attribute fields in the Target Occupant Features parameter value that will be populated with field values from the Input Occupant Table parameter value. The fields must exist in the Target Occupant Features parameter value before running the tool. It is recommended that you map fields from the Input Occupant Table parameter value to fields from the Target Occupant Features parameter value that have the same field type.

Field Mappings
Insert new occupants
(Optional)

Specifies whether unmatched occupant records for the Input Occupant Table parameter value will be added to the target occupant features layer.

  • Checked—Unmatched occupant records will be added to the target occupant features layer. This is the default.
  • Unchecked—Unmatched occupant records will not be added to the target occupant features layer.
Boolean
Delete occupants not included in the Input Occupant Table
(Optional)

Specifies whether unmatched occupant records for the Input Occupant Table parameter value will be deleted from the target occupant features layer.

  • Checked—Unmatched occupant records will be deleted from the target occupant features layer. This is the default.
  • Unchecked—Unmatched occupant records will not be deleted from the target occupant features layer.
Boolean

Derived Output

LabelExplanationData Type
Updated Occupant Features

The updated version of the target occupant features used for this tool.

Feature Layer

arcpy.indoors.UpdateOccupantFeatures(target_occupant_features, {in_unit_features}, {in_occupant_table}, {occupant_id_from_target_occupant_features}, {occupant_id_from_input_table}, {unit_id_from_units_features}, {unit_id_from_input_table}, {occupant_attributes_mapping}, {allow_insert}, {allow_delete})
NameExplanationData Type
target_occupant_features

The target feature layer, feature class, or feature service to which occupant records will be added, updated, or deleted. The input must contain unique values that identify each occupant and must conform to the Occupants feature class in the Indoors model.

Feature Layer
in_unit_features
(Optional)

The input polygon features representing building spaces that may be occupied. The input must be a feature layer, feature class, or feature service that conforms to the Units feature class in the Indoors model. The centroid of each space will be used as the point location of the occupant or occupants.

Feature Layer
in_occupant_table
(Optional)

The input table that contains information about building occupants.

The input table must be a geodatabase table, a sheet in a Microsoft Excel workbook (.xls or .xlsx file), a comma-delimited text file (.csv), or an OLE DB table.

Table View
occupant_id_from_target_occupant_features
(Optional)

The field in the target_occupant_features parameter value that will be used as the primary key to associate occupants with the in_occupant_table parameter values. The field values must be unique.

Field
occupant_id_from_input_table
(Optional)

The field in the in_occupant_table parameter value that will be used as the primary key to associate occupants with the target_occupant_features parameter values. The field values must be unique.

Field
unit_id_from_units_features
(Optional)

The field in the in_units_features parameter value that stores the unique space identification information that will match the unit identifier from the in_occupant_table parameter value. The field values must be unique.

Field
unit_id_from_input_table
[unit_id_from_input_table,...]
(Optional)

The field or fields in the in_occupant_table parameter value that will be used as the primary key to associate occupant space assignment with the in_units_features parameter values. If a field value is empty, the occupant will be loaded as unassigned.

This parameter supports multiple fields from an input occupant table that stores more than one space assignment of an occupant. Only the fields provided will be used to update the Occupants feature class.

If no parameter value is provided, the occupant's seating assignments will not be updated in the Occupants feature class. Instead, the records in the Occupants feature class will be matched to records in the input occupant table and attributes mapped in the occupant_attributes_mapping parameter will be updated.

Field
occupant_attributes_mapping
(Optional)

The attribute fields in the target_occupant_features parameter value that will be populated with field values from the in_occupant_table parameter value. The fields must exist in the target_occupant_features parameter value before running the tool. It is recommended that you map fields from the in_occupant_table parameter value to fields from the target_occupant_features parameter value that have the same field type.

Field Mappings
allow_insert
(Optional)

Specifies whether unmatched occupant records for the in_occupant_table parameter value will be added to the target occupant features layer.

  • INSERT_OCCUPANTSUnmatched occupant records will be added to the target occupant features layer. This is the default.
  • NO_INSERT_OCCUPANTSUnmatched occupant records will not be added to the target occupant features layer.
Boolean
allow_delete
(Optional)

Specifies whether unmatched occupant records for the in_occupant_table parameter value will be deleted from the target occupant features layer.

  • DELETE_OCCUPANTSUnmatched occupant records will be deleted from the target occupant features layer. This is the default.
  • NO_DELETE_OCCUPANTSUnmatched occupant records will not be deleted from the target occupant features layer.
Boolean

Derived Output

NameExplanationData Type
updated_occupant_features

The updated version of the target occupant features used for this tool.

Feature Layer

Code sample

UpdateOccupantFeatures example 1 (Python window)

The following Python window script demonstrates how to use the UpdateOccupantFeatures function in immediate mode. In this example, the inputs and outputs are all in the same geodatabase.


import arcpy
arcpy.indoors.UpdateOccupantFeatures('C:/ExampleCampus.gdb/Indoors/Occupants', 
                                    'C:/ExampleCampus.gdb/Indoors/Units', 'C:/OccupantsData/2022Occupants.xlsx/2022Q2$',
                                    'EMAIL', 'EMAIL',
                                    'UNIT_ID', 'SPACE_ASSIGNMENT', 'KNOWNAS "Known As" true false false 255 Text 0 
                                    0,First,#,C:/OccupantsData/2022Occupants.xlsx/2022Q2$,KNOWNAS,0,255;SITE_ID "Site ID" true true false 255 Text 
                                    0 0,First,#',
                                    True, True)
UpdateOccupantFeatures example 2 (stand-alone script)

The following stand-alone script demonstrates how to use the UpdateOccupantFeatures function.


# Import system modules import arcpy
# Set local variables 

target_occupant_features = r'C:\ExampleCampus.gdb\Indoors\Occupants'
in_unit_features = r'C:\ExampleCampus.gdb\Indoors\Units'
in_occupant_table = r'C:\OccupantSpreadsheets\BuildingL.xlsx\OccupantsSeatingAssignment$'
occupant_id_from_target_occupant_features = 'EMAIL' 
occupant_id_from_input_table = 'EMAIL' 
unit_id_from_units_features = 'UNIT_ID'
unit_id_from_input_table = "SPACE_ASSIGNMENT"
occupant_attributes_mapping = 'KNOWNAS "Known As" true false false 255 Text 0 0,First,#,
C:\OccupantSpreadsheets\BuildingL.xlsx\OccupantsSeatingAssignment$,KNOWNAS,0,255;CONTACT_PHONE "Contact Phone" true true false 255 Text 0 0,First,#,
C:\OccupantSpreadsheets\BuildingL.xlsx\OccupantsSeatingAssignment$,CONTACT_PHONE,0,255;CONTACT_EXTENSION "Contact Extension" true true false 255 Text 0 0,First,#,
C:\OccupantSpreadsheets\BuildingL.xlsx\OccupantsSeatingAssignment$,CONTACT_EXTENSION,-1,-1;SITE_ID "Site ID" true true false 255 Text 0 0,First,#;JOB_TITLE "Job Title" true true false 255 Text 0 0,First,#,
C:\OccupantSpreadsheets\BuildingL.xlsx\OccupantsSeatingAssignment$,JOB_TITLE,0,255;ORG_LEVEL_1 "Department" true true false 255 Text 0 0,First,#,
C:\OccupantSpreadsheets\BuildingL.xlsx\OccupantsSeatingAssignment$,ORG_LEVEL_1,0,255;ORG_LEVEL_2 "Team" true true false 255 Text 0 0,First,#,
C:\OccupantSpreadsheets\BuildingL.xlsx\OccupantsSeatingAssignment$,ORG_LEVEL_2,0,255;START_DATE "Start Date" true true false 8 Date 0 0,First,#,
C:\OccupantSpreadsheets\BuildingL.xlsx\OccupantsSeatingAssignment$,START_DATE,-1,-1' 

allow_insert = True
allow_delete = True

# Run the tool 
arcpy.indoors.UpdateOccupantFeatures(target_occupant_features, in_unit_features, in_occupant_table,
                                     occupant_id_from_target_occupant_features, occupant_id_from_input_table,
                                     unit_id_from_units_features, unit_id_from_input_table, occupant_attributes_mapping,
                                     allow_insert, allow_delete)

Environments

Licensing information

  • Basic: No
  • Standard: No
  • Advanced: Requires ArcGIS Indoors Pro or ArcGIS Indoors Maps

Related topics