This post describes how you can use:
You can leverage Survey123 to collect requests from users for an account. Once they complete the form, the data is stored in a feature layer. You can use this feature layer in a Dashboard, where appropriate staff can approve or deny the requests. Then, you can schedule an ArcGIS Notebook to run on a specified interval to create the accounts for approved requests.
Based on working with organizations in Emergency Management, my colleague and I would highly recommend that you deploy this solution if:
Check out this sample survey. If you’re using Survey123 connect, you can use this template xls to create your Survey and Hosted Feature Layer.
Since ArcGIS Online requires certain information to create an account, your survey must capture the following information from users:
Then, you could capture additional, useful information about users, such as:
Finally, you’ll need a couple of hidden questions for the ArcGIS Hosted Notebook to leverage during account creation:
Publish your survey to create the form item and hosted feature layer. Before you share the survey and appropriate layer with the public, brush up on best practices for securing data in public surveys! Whether you’re using Survey123 Connect or the Survey123 web designer, you want to ensure that you’re collecting data responsibly.
If you want accounts to be created automatically, skip to step 3. If you want to review and approve individual requests before account creation, follow the steps below!
We usually go with an ArcGIS Dashboard table element so we can update attributes directly. You could use an embedded Survey123 in your ArcGIS Dashboard or use ArcGIS Experience Builder edit widget or survey widget. The objective is simply to create an application that enables certain users to change the status of the request from “New” to “Approved”
Start by creating a view of your access request feature layer so you can enable query and attribute editing. This view could be filtered to show only the requests where Request Status = New or show all requests. The view needs to be editable, and have update enabled.
Next, add your view to a webmap so you can configure the form for editing. Your form should enable the user to edit the Request Status field. You can use Arcade to calculate the “Approved By” field as the User’s name and Approved Date field to now.
After configuring the form, go to “properties”, expand “information” and click “Save” to save the form configuration to the layer. This step enables us to access the form via the ArcGIS Dashboard, without a webmap.
Now you are ready to create an ArcGIS Dashboard with a table element. Connect the table element to the Approval View created earlier. Configure the table element to show features, pick the columns you want to see, and toggle on “Allow attribute updating”
Now, users can view the access requests and click the pencil icon to approve. If you want, you can configure additional elements, like an indicator sum of requests.
Don’t forget to share your ArcGIS Dashboard and the Approval View with any users who need to approve requests. This app enables you to share the administrative responsibility of approving accounts without granting actual administrative privileges! Wow!
To use an ArcGIS Hosted Notebook to create accounts, you’ll need to use an account with the necessary administrative privileges in the ArcGIS Online Organization where the accounts will be created.
Check out this sample and download a copy to deploy in your organization. This notebook is often used to create accounts in an ArcGIS Hub Online Community Organization because the administrator has prevented the public from creating community accounts – If this is the case for you, check out how the sample notebook authenticates into two organizations: gis provides access to our Feature Layer, and hub_gis is where we will create the accounts.
If you are creating accounts in one ArcGIS Online Organization, remove the definition of hub_gis below, and replace all instances of hub_gis with gis.
Next, you’ll need to establish some initial variables. Replace the user_management_layer <item id> with the item ID of the feature layer containing your account request information. Additionally, if you would like all new accounts placed into one centralized group (such as a Followers group for an initiative), update the followers_group_id <item id> with the appropriate group ID. If you don’t need to add uses to a central group, feel free to comment out that line.
Then, if you configured the Approval App, you will query your account request feature layer for records where the Request Status field equals ‘Approved’ and Member Created equals ‘No’ – so the script will create accounts only for requests that have been approved but not processed.
If you did NOT configure an approval app, change the query below to “member_created = ‘no’” so requests will be processed without manual intervention
To complete the updates to the script, replace “_mycommunity” with the username identifier of your choice and update the new_usertype and new_role for the user type and role you’d like to assign to your users.
To explain the rest of the notebook: from here, it will check if the user already exists before creating their account, optionally add them to groups, and update the account request feature layer.
Remember: if you are NOT creating accounts in a Hub Premium Community Organization, change all instances of hub_gis to gis.
Finally, you can save your changes and schedule a notebook task so this process runs on a recurring basis – we typically see this as a nightly process but pick a time-frame that works for your organization’s needs.
If you’ve made it this far, you should have created the following items
Name | Item Type | Sharing Level |
Access Request Form | Survey123 Form | Public |
Public Submission View | Hosted Feature Layer (View) | Public |
Access Request Layer | Hosted Feature Layer | Not shared |
Approval View | Hosted Feature Layer (View) | Shared with Owner or Group |
Approval App | ArcGIS Dashboard | Shared with Owner or Group |
Account Creator | ArcGIS Hosted Notebook | Not shared |
Hopefully the solution outlined above enables your users to receive accounts more efficiently and frees up some of your time to focus on higher-value GIS tasks!
If you have questions or challenges implementing this workflow, post a comment below. We’d also love to hear about any modifications you make!
As we publish additional related resources, we’ll add links to those here.