Select to view content in your preferred language

Automatically populate NA for unfilled fields in Survey123 Connect

95
3
Tuesday
WFCAdmin
Regular Contributor

Hi everyone,

I’m working with a Survey123 Connect form for a salmon spawning survey. The survey layer has many fields, and depending on what data is collected at a point, many of those fields may not be populated.

Instead of leaving these fields <null>, I’d like them to be filled with "NA" via the survey. All of the fields that should default to "NA" are select_one fields, and all are tied to relevant expressions.

I’ve tried setting this default:

if(${Data_Type} = 'Reach Start' or ${Data_Type} = 'Reach End', '', 'NA')

and using this choice filter:

(${Data_Type} != 'Reach Start' and ${Data_Type} != 'Reach End') or name != 'NA'

This is for "Flow" data, which is only being gathered when the 'Reach Start' or 'Reach End' Data_Type is selected.

Here is the Relevant expression

${Data_Type} = 'Reach Start' or ${Data_Type} = 'Reach End'

My attempt did not work.

What’s the best approach to populate "NA" for all relevant fields without manually adjusting each one? Any sample formulas, workflows, or best practices would be greatly appreciated!

Thanks,
Aaron

0 Kudos
3 Replies
CodyPatterson
MVP Regular Contributor

Hey @WFCAdmin 

I found a post here: https://community.esri.com/t5/arcgis-survey123-questions/using-null-or-not-null-values-in-a-field-to...

That outlines this here: 

if((string-length(${Location})>0),'existing','new')

This basically just says, if a field is present, return existing, else, return NA, in your state, you could extend the if statement to validate that it is a Reach Start or Reach End, and if it is, then it's valid, otherwise, return the NA value. Something like below, note that I had taken notes from the Google Search AI to create this function here:

if(${Data_Type} = 'Reach Start' or ${Data_Type} = 'Reach End', ${Flow_input}, 'NA')

 

Cody

0 Kudos
WFCAdmin
Regular Contributor

Thank you for the suggestion, Cody. I tried it and a few variations, but no luck. I took a look at the thread you linked and tried that format with my data, but that did not work either.

I will keep playing around. Appreciate your help!

Aaron

0 Kudos
ZenMasterZeke
Frequent Contributor

You could just set the Default column to "NA" for all fields, and any entry users make will override that.