Select to view content in your preferred language

Automated process for updating a list of domain values from a csv list

133
1
4 weeks ago
janine_mapss
Occasional Contributor

Hi all,

I have a field in a feature layer that I need to generate domain values for. I have looked at the "create list", "generate list" route in the data tab but this is a manual process and will only generate domain values for options that have already been selected in the feature layer.

This field is linked to an external csv choice list. I have a notebook set up to update this csv regularly based on values from another feature layer. I need to generate domain values for all choices in this csv list. Does anyone have any ideas on how I could this?

1 Reply
ChristopherCounsell
MVP Regular Contributor

One option is to remove the list from the field. Survey123 doesn't need it. You will need the list if you're using it elsewhere e.g. map form or direct table edits.

Otherwise it looks like you'll need to use the update definition against the service. Some examples of that below. Definitely test on another layer first.

https://community.esri.com/t5/arcgis-api-for-python-questions/create-hosted-feature-layer-coded-valu...

https://community.esri.com/t5/arcgis-enterprise-blog/update-a-hosted-field-domain-with-the-python-ap...

You would need additional logic to handle new values or removing undesired ones. Could be a column in the CSV?

Python could be added to the existing notebook.

0 Kudos