Select to view content in your preferred language

CSV coded value choice lists for view layers

513
1
12-22-2022 03:41 PM
JCooley_ClackamasSWCD
Occasional Contributor

As many of you know managing feature layer domains is a major time suck and tedious if you stick with a supported work flow.  You can spend hours populating and organizing coded values using the AGOL UI.  We have to maintain lists of pesticide applicators for ten or more contract crews that collect pesticide application data using Field Maps.  So you can imagine how excited I was when ESRI announced that choice lists can be managed via the Field Maps web app form builder by uploading a CSV.  I optimistically assumed that this improvement was about to eliminate our domain management issues.  I was dismayed when I learned that choice lists can not be managed for view layers and can only be applied to hosted feature layers.  We exclusively use view layers for field data collection to limit what features can be added, deleted and updated by field users.  After further investigation I found that editing the choice list in the Field Maps Web app actually modifies the field's coded value domain.  This was surprising since Field Maps form elements and associated settings are stored as part of the Web Map (as far as I am aware). This important fact is omitted from the documentation.   

It would be great if choice lists (and the coded value domain) could be managed for view layers.  It wouldn't be as odd as modifying the source data's domains since you can maintain different coded values for view layers already. 

1 Reply
RhettZufelt
MVP Notable Contributor

I started using python code from here to update/change my Domains on hosted feauture layers.  Works well, and lets me pick the order of the domains in the drop downs.

I run it from a Notebook to make it easy.  Just copy/paste the "new" domain list (update_dict) in the order I want into the update_dict cell, then run.  Will completely replace the domain for the field specifiec with the new list.

I maintain a separate notebook for each field I have Domains on to make it easy.

Also, not sure if it would break anything, and would need to test, but it appears as if you can change the domains for a hosted feature layer and any views of that layer independantly.

R_