Hi, I am trying to get a field to return specified terms depending on the selections in another field.
For example:
Field 'Bird' is a select_one field, and choices are 'Sparrow', 'Pigeon', 'Hawk', 'Duck', 'Eagle'
Field 'Category' is a calculate field, and I would like the field to return the value 'Predator' if 'Hawk' or 'Eagle' are selected in the 'Bird' field, and 'Prey' if neither are selected.
The formula I have is:
if(selected(${Bird},'Hawk'),'Predator','Prey') OR if(selected(${Bird},'Eagle'),'Predator','Prey')
The issue is, the value turning up in the output of the field 'Category' is 'true', REGARDLESS of what is selected in the 'Bird' field.
From what I've been able to find through Google, the formula should be giving me either 'Predator' or 'Prey' depending on the selection choice in 'Bird'.
What do I need to change?
Solved! Go to Solution.
That is not proper syntax. Also can just use = for select one
if(${Bird} = 'Hawk' or ${Bird} = 'Eagle', 'Predator', 'Prey')
hope that helps
That is not proper syntax. Also can just use = for select one
if(${Bird} = 'Hawk' or ${Bird} = 'Eagle', 'Predator', 'Prey')
hope that helps
Hi Doug, that's worked perfectly, thank you!
I got the original formula from a colleague and it worked for her survey, but turns out she was using it in a select_one field while I was not.
Thanks again!