Survey123 Using Conditional Calculations to auto-populate fields

02-17-2018 07:24 AM
Occasional Contributor


I am working on a utility pole inspection form that will have multiple questions and am trying to figure a way to create a shortcut field (Quick_Pick) that will auto populate these questions when either everything is Okay or they cannot inspect the pole while still allowing them to choose other answers if needed.  So far I have the following questions setup.  Both fields are select_one type with their corresponding choice lists.

Field Name               Choices

Quick_Pick               "OK" or "No Inspect"

Pole_Condition        "OK" or null

Ive been hacking around trying to create a calculation on the Pole_Condition field without any success.  Below is my latest failed attempt.  Is what I'm trying to do even possible and if so what am I doing wrong?  Any help would be appreciated!

if(selected(${Quick_Pick},'OK'),'OK', or selected(${Quick_Pick}, 'No_Inspect'), 'null')


Tags (2)
0 Kudos
10 Replies
New Contributor III

James, I'm not sure if this goes here in this thread, but...I am trying to use an if statement for a calculation but I don't know if it will work. I have a calculate field that adds up all the other calculated fields. But not all calc fields will be filled in, these are set up with the relevant field. My calc field will work in my survey if I select everything in my select multiple, then the calcs all run, but how do I get it to run the calc even if fields are not selected, or filled in? So if I select 3 out 4 in my select multiple question, then calculate those values, the last calc field will not run. I need to select all 4. I want the option to run it with everything or anything selected and filled in. And I am not sure how to do that.

0 Kudos