Auto-populate select_one using conditional if( with calculation in Survey123

357
2
Jump to solution
08-22-2019 12:54 PM
Highlighted
New Contributor

I am trying to auto-populate a select_one type (place) list by using if statement in calculate field based on geopoint location in geofence with data attributes successfully extracted from the polygon using Survey123 Connect. I am using the following conditions in an if statement within calculation column for select_one to try to auto-populate a selection based on locationID attribute but it has been unsuccessful thus far. I have attached a snips of select_one place calculation and place choice list from the spreadsheet. Please let me know what I am missing, Thanks!

Reply
0 Kudos
1 Solution

Accepted Solutions
Highlighted
New Contributor III

I think you need to make a slight update to the if statements. Assuming the values fs1, fs2, and tw1 are text, they should have quotes so that they are not read as variables. I think it should be something like the following:

if(${locationID}='FS1','fs1',if(${locationID}='FS2','fs2',if(${locationID}='TW1','tw1','')))

View solution in original post

2 Replies
Highlighted
New Contributor III

I think you need to make a slight update to the if statements. Assuming the values fs1, fs2, and tw1 are text, they should have quotes so that they are not read as variables. I think it should be something like the following:

if(${locationID}='FS1','fs1',if(${locationID}='FS2','fs2',if(${locationID}='TW1','tw1','')))

View solution in original post

Highlighted
New Contributor

Yes values are text and I did miss adding quotes, thank you for catching it and for your assistance!

Reply
0 Kudos