Conditionally set field to be readonly in Survey123

1350
5
Jump to solution
02-20-2020 06:47 PM
YuyingLi
New Contributor II

Hello,

I would like to set the fields read only based on the coniditions (the preivous choice)...Can I do that? Here is what I put the the read only column for the field:


if (${purpose}='inplementation', 'yes', '')

The purpose field is the dropdown - based on the selection, the other field (B) will either read only or editable.

But with the fomular, the field B becames read only no matter what the drop-down selction is.

Any suggestions?

Thanks,

Yuying

0 Kudos
1 Solution

Accepted Solutions
Chris_Counsell
Esri Contributor

Hi,

Is there a typo in your formula? 

if (${purpose}='inplementation', 'yes', '')

Easier to do it without the if i.e. in readonly:

${purpose} = 'implementation' or ${purpose} = ''

Cheers,

Chris

View solution in original post

5 Replies
Chris_Counsell
Esri Contributor

Hi,

Is there a typo in your formula? 

if (${purpose}='inplementation', 'yes', '')

Easier to do it without the if i.e. in readonly:

${purpose} = 'implementation' or ${purpose} = ''

Cheers,

Chris

YuyingLi
New Contributor II

Yes – thanks! Works great!!

Yuying Li, GISP

D 858.712.8381 M 858.380.8024

hdrinc.com/follow-us<http://hdrinc.com/follow-us>

Chris_Counsell
Esri Contributor

Glad to hear we could help Yuying.

Can you please mark the answer as correct.

Thanks, Chris

JamieKelly1
Occasional Contributor

Will this also work in the webform?  I tried and doesn't seem to work, maybe I am doing something wrong.

Edit:  Forgot to mention that it was working fine in the IOS app before I tried it out in the webform.

0 Kudos
wilcow
by
Occasional Contributor

did you get an answer to this? I'm unable (so far) to set a Multiple Choice question to Read only