Select to view content in your preferred language

Open List Retain value when Editing Survey

1009
16
3 weeks ago
DominicRobergeIADOT
Frequent Contributor

Hello,

I am following the steps from this post Open List and it's working fine to ge my unique list of values in the dropdown list

https://community.esri.com/t5/arcgis-survey123-blog/survey123-tricks-of-the-trade-open-lists/ba-p/11...

However, when I Edit the survey, I "loose" the original value that was entered. How can I retain the original value when I am in edit mode?

- I've tried Calculated field , not working

 

DominicRobergeIADOT_1-1748382234927.png

 

Attached the section of the spreadsheet showing above.

The process is working fine with CSVs... I just would like to be able to use the "live" data from the map service as users start to add more options for each dropdowns.

 

Any help or suggestions would be much appreciated.

 

Thanks!

 

0 Kudos
16 Replies
ChristopherCounsell
MVP Regular Contributor

The exception you identify is the actual issue of this post.

The current spreadsheet and blog workflow allows for dynamic entry of additional values into a list. It achieves this through two null fields for a dummy user interface. These then calculate into a hidden field that actually stores the data.

The issue is that these fields are NULL. When you edit the existing record via the survey123 website or the survey123 inbox, the form loads again and the NULL fields are empty. The calculation triggers and clears out the existing value in the hidden field.

We can brainstorm ways to only calculate the hidden field in certain circumstances but most of these methods involve loops. E.g. calculating coalesce(field1)  on the same field1 creates a dependency loop as you are running the calculation on the same field the input is required from.

I think the best bet would be for the user to use the calculationMode=whenEmpty in the parameters for the hidden species question. However it also means it won't be able to be updated later on when the user interacts with the null ui

0 Kudos
Neal-Kittelson
Frequent Contributor

Yes, but the solution to that is your original solution to make those 2 fields not "null".  When I tested it, I needed to perform a fresh republish and rebuild the species list, but the original answers were retained, was able to alter my original answer which in turn updated the live list. And in new submission see the live list.   I can see potential for this causing headaches, but what he is proposing is possible without running into cyclic dependency. 

0 Kudos
DominicRobergeIADOT
Frequent Contributor

@Neal-Kittelson  and @ChristopherCounsell 

Thank you both for all the inputs. As I mentioned before, I am trying to minimize the number of fields in the feature class. So I tested adding a true field for the dropdown list.... everything is working fine EXCEPT if I select the Other option. 

ex: Original WEI_BMS field has value of JSON, I update the data using the dropdown field (WEI_DBMS_List) to Shapefile and Submit.... both fields have the Shapefile value

If original WEI_BMS field has value of Shapefile, I update the data using the dropdown field (WEI_DBMS_List) to Other ... then I get the option to add a new value: let's say I add KMZ and Submit.... WEI_BMS field will have KMZ and the new WEI_DBMS_List field will have Other has a value.

DominicRobergeIADOT_0-1748541377254.png

I added a pulldata formula in the Calculate and if I click Recalculate I will get the JSON there. I don't want users to have to click to refresh the data.

So how could I pass the WEI_DBMS value to the dropdown list if the value is Other?

I tried coalesce and if statement and both of them create an error with the parsing.

 

0 Kudos
Neal-Kittelson
Frequent Contributor

I am not sure where you are on this with out providing an xlsx.  Following our thread I think the provide example attached is what you are trying to achieve.  Try this out with a fresh publish, You will have to update the search url and build your list by make some submissions and manually editing the entries in the feature layer.  See if this example is what you want, and then update your form based on it.  And you may need to do a fresh publish on your form to get it to work correctly.

0 Kudos
Neal-Kittelson
Frequent Contributor

Are you pulling your list from the same feature layer that you are writing your answers to?  Your field that the answers are being written to is "WEI_DBMS" and you are searching a field titled "SDBMS".  It appears, if I am following the "Tricks" post correctly that those two fields should be the same and that you are searching from and writing to the same feature.  

NealKittelson_0-1748398062945.png

 

0 Kudos
ChristopherCounsell
MVP Regular Contributor

It's a dummy field

It's field binding is null

Neal-Kittelson
Frequent Contributor

the WEI_DBMS field is not null, it is string and is the coalesce calculation where the data should be stored.

@ChristopherCounsell Nevermind, I see what you are saying.  The field  that appears in the form is not being saved! Hence why it appears blank in the form on edit.

It still appears the answers are being saved to a different feature/field then they are being pulled from though.

0 Kudos