Select to view content in your preferred language

Calculate domain list from hosted CSV file

851
6
Jump to solution
12-28-2023 08:29 AM
MikeFiguray
New Contributor III

Hello,

I have a hosted CSV file used to update incident names for the Debris Management solution. It is used in Survey123 to populate a combo box of incident names listed in the "Incidents.csv" file which is hosted in AGOL.

At the time of a new incident, the idea is that you update one csv file, and all S123 forms will use the updated list taken from the csv file to create a choice list for mobile users to select the incident name.

I would like to extend this functionality to use the same hosted csv file to populate the drop down menu for a  field in the web map smart forms if possible. Does anyone know if this is possible?

Any help would be greatly appreciated!

Thank you,
Mike

 

 

1 Solution

Accepted Solutions
AlixVezina
Esri Regular Contributor

Here's an approach that may work for what you are trying to achieve: Use the filtered value as a default field value - Esri Community

Basically, you would need one layer from which to pull the value (e.g. Incident ID or Name). That layer could be populated with new values as needed. Using a Filter, you would define which value to use for the current incident, and using the expression shown in the blog, you will be able to automatically populate the incident ID value into all the features you create after applying the filter.

I hope this makes sense, I'll try to clarify if it doesn't but hopefully, the samples provided in the blog will help...

View solution in original post

6 Replies
Teresa_Blader
Occasional Contributor III

Following! Also interested in this…

Teresa Blader
Olmsted County GIS Specialist
0 Kudos
bbollin
Esri Contributor

 

@MikeFigurayare you going to be regularly changing and updating the domains? If you are wanting to easily import a large set of domains from a CSV I think you can do this fairly easily without manually copy/paste.

  1. With your CSV containing the domain values for the field you want to match to, navigate to the item details page of your hosted layer
  2. Click Update data, then Add features. You should be able to upload the file
  3. Ensure that the filed you want the domains in is matched correctly (others can be unmatched)
  4. Then If you go into the settings tab on the item details page of the host feature layer, you should be able to navigate to the field, click Create list and then Generate list from all the newly imported values.
  5. If you want to remove the data you just imported, for can delete the features but still keep the domains list

bbollin_0-1703866532227.png

bbollin_1-1703866591181.png


Does that make sense?

0 Kudos
MikeFiguray
New Contributor III

@bbollin Thanks for the advise, but if I understand what you are suggesting, I would need to do this for every feature layer. The issue is that when there is a Tornado for example, we need crews on the road as quickly as possible assessing damage and scheduling cleanup. I would need to use the newly created incident name across around 15-20 different surveys and smart forms.

I am hoping there is a way to update 1 csv file at the begining of an incident, and that IncidentID would be available in all surveys and smart forms that are linked to it. It works with Survey123 using the appearance column in S123 connect and "autocomplete search('IncidentNames','matches','name')". I just haven't been able to find a way to do the same thing using an arcade expression.

Even better would be if I could figure out a way to pre-populate the answer in the forms and surveys as well, but right now we're working on baby steps 😀

Teresa_Blader
Occasional Contributor III

Same here @MikeFiguray ! @bbollin The goal is an external choice list "domain" - because you want to apply it across multiple layers and have Field Maps (like what Survey123 can do with autocomplete(search...)) pull the options in the drop down... so just one list is maintained (maybe even by someone who doesn't own or operate the other layer). I'm trying to get this to happen for MUTCD sign codes (and Damage Assessment Incident names/IDs) - otherwise a DBA has to keep it updated and the DBA is not the content expert. 

Teresa Blader
Olmsted County GIS Specialist
AlixVezina
Esri Regular Contributor

Here's an approach that may work for what you are trying to achieve: Use the filtered value as a default field value - Esri Community

Basically, you would need one layer from which to pull the value (e.g. Incident ID or Name). That layer could be populated with new values as needed. Using a Filter, you would define which value to use for the current incident, and using the expression shown in the blog, you will be able to automatically populate the incident ID value into all the features you create after applying the filter.

I hope this makes sense, I'll try to clarify if it doesn't but hopefully, the samples provided in the blog will help...

MikeFiguray
New Contributor III

@AlixVezina this is exactly what I was looking for! I created a view layer and added it as a hidden layer to several of my maps, and applied the expression in the blog to the incidentID field in the smart forms.

By changing the filter on the 1 view layer, it changes the pre-populated incidentID response in each web map and smart form. This worked perfectly!

Thanks so much for the article and help!