return a boolean value (0 or 1) different than label

825
3
Jump to solution
12-20-2021 02:43 AM
GrégoireCATINEAU
New Contributor III

Hello,

I would like to return a boolean value : 0 or 1 for a 'yes' or 'no' request.

I use text field type because apparently there are no boolean field type.

how to return a value different than the label field ?

0 for no

1 for yes 

 

0 Kudos
1 Solution

Accepted Solutions
FrankOuyang
Esri Contributor

You can edit this in Survey123 Connect xlsx spreadsheet:

1. In you choice sheet, set the name for your yes label as 1 and no label's name as 0.

2. In the survey sheet, when people select yes, the record will be 1 and no will be 0. But these two fields are stored as text. What you can do is that, in the calculation field, set "number(${question})" which will then convert the submission into number. 

 

Please let me know if this works and any further questions. 

View solution in original post

3 Replies
JavierCMartínezPrieto
Occasional Contributor

Good,

if you use conditional expressions, the value becomes boolean.

greetings

 

url:https://doc.arcgis.com/es/survey123/desktop/create-surveys/xlsformformulas.htm

 

JavierCMartnezPrieto_0-1640006203437.png

 

Javier C. Martinez Prieto
FrankOuyang
Esri Contributor

You can edit this in Survey123 Connect xlsx spreadsheet:

1. In you choice sheet, set the name for your yes label as 1 and no label's name as 0.

2. In the survey sheet, when people select yes, the record will be 1 and no will be 0. But these two fields are stored as text. What you can do is that, in the calculation field, set "number(${question})" which will then convert the submission into number. 

 

Please let me know if this works and any further questions. 

GrégoireCATINEAU
New Contributor III

Ok, thank you.

0 Kudos