The Coronavirus Business Continuity solution helps organizations have a clear understanding of workforce capacity during the Coronavirus 2019 (COVID-19) pandemic. This is achieved by having individuals, or team leads, check in and provide work and health information via a survey.
The documentation included with the Coronavirus Business Continuity solution includes a key workflow for loading personnel information from your organization into the solution. One of the important layers that must be populated is the Personnel Information table. This article will help organizations leverage a Jupyter Notebook and the ArcGIS Python API to quickly populate the Personnel Information table with existing ArcGIS users. Before getting into the details of how it’s done, let’s discuss how personnel information is used within the solution.
You may notice on the Individual Check-in survey above that the individual filling out the survey does not enter their name. This simplifies the survey and reduces the likelihood of bad data. It also streamlines the check-in process for employees so they can quickly fill out the survey and start their work day. When you authenticate to ArcGIS, your ArcGIS username is captured and associated with additional pieces of information, such as your designated office location and team you are part of. That information then drives the capabilities present in the Personnel Status Dashboard.
The Personnel feature layer drives much of the functionality present in the Individual Check-in and Personnel Status Dashboard. This layer contains a table to store the name of each individual, their team, assigned office location, and ArcGIS username.
The Personnel Information table can be populated from a variety of data sources. A simple spreadsheet of users, their work location, etc. might work well in situations where you need to create new ArcGIS identities for your staff. But what if most of your existing staff already have ArcGIS identities and you need to set up the personnel table? Manually getting their ArcGIS identities and adding them and the other necessary information to the Personnel Information layer may be challenging for many organizations.
If you would like, download this Jupyter Notebook, review the requirements, and follow along with the rest of this article. Note, if you don’t have Jupyter Notebook, this standalone script can be used in lieu of a Jupyter Notebook.
- Python 3.6.9 or higher installed
- ArcGIS and Jupyter* (*Not necessary but used in this article.) python libraries installed
- You are the owner of the Personnel layer item
When you startup Jupyter Notebook, click Upload a notebook file, and select the notebook you downloaded.
Once opened, enter the following parameters:
- Your username
- ArcGIS Online Organization URL
- Item ID of the Personnel hosted layer
Note: If you are running the the standalone python script, you will need to enter your password.
The easiest way to get the Item ID of the Personnel feature layer is by going to the layer’s description page.
- Sign into your ArcGIS Organization.
- At the top of the site, click Content.
- On the My Content tab, type COVID-19 in the search box.
- Under Item Type Filters on the left side, click Layers – Feature Layers. This will filter all the COVID-19 content to only show the layers.
- Click on the item title for the Personnel feature layer to view its details.
- In the URL, copy the string after “?id=”.
Once the parameters have been filled out, you can step through each cell by pressing Shift + Enter. When you get to the cell tagged “Logging into your ArcGIS Online Organization and retrieving user accounts”, a dialogue will appear asking for you to enter your password.
After adding your password, click Enter and Shift + Enter to run through the rest of the cells. Alternatively, you can run all cells automatically by going to the Kernel context menu and clicking on Restart & Run All.
The script duration is dependent on the number of users in your organization. After it completes, navigate to the data tab on the Personnel description page and select the Personnel Information layer to review the Name and Username information that was just populated.
Using this script can save you a lot of time if you have hundreds of users in your organization.
Note, the Team and Office Location columns will be blank and will need to be manually filled out. You can, quickly export this information out to csv to manually update by going through Export Data -> Export to CSV file and filling out the details.
A new window will open to the CSV item, which can be downloaded and modified. Since the Personnel Item contains two layers, they are stored in a zip file. Extract and open the file named Personnel Information and populate the Team and Office Location columns the correct values for each row.
Once finished, you can update your Personnel Information layer in ArcGIS Online following documentation on the solution site.