My question type in survey 123 is wrong

4513
27
Jump to solution
07-17-2021 08:46 AM
BillBlythe
New Contributor III

I am using the "note" question in survey 123 connect and I just found out that it will not do what I need. 

This is my question that I have built in the XLSForm

note question.PNG

Compliant or Not Compliant will not show up in my data export into excel.

this is what shows up in the excel.

ISA.PNG

How can I get either Compliant or Not Compliant to be marked in excel?  I am wanting to use this a lot in the survey to make collection quick and to show is something right or not.

Thank you

Todd

todd@beneficialdesigns.com

1 Solution

Accepted Solutions
ThomasHamill
Occasional Contributor II

@BillBlythe, these were the expressions I used:

ThomasHamill_0-1626806402291.png

 

For the Compliance text field it is:
if(selected(${ClearSpaceProvided},'yes'),'Compliant',if(selected(${ClearSpaceProvided},'no'),'Not Compliant',''))

and for the Compliancebcp it is:
if(selected(${benchClearSpaceWidthlength},'yes'),'Compliant',if(selected(${benchClearSpaceWidthlength},'no'),'Not Compliant',''))

I attached the form with these calculation expressions included.

 

Kindest Regards,

t

View solution in original post

27 Replies
curtvprice
MVP Esteemed Contributor

Todd,

The Note type is not a pick list, or choice, it is for entering free text.

Are you sure you need to use XLSForms, you can do an awful lot without having to get into the desktop app.

Free course: Get Started with ArcGIS Survey123

If you want to use XLSForms, here's a video that goes through it all: Advanced XLSForm Techniques

Hope this helps you out. Sometimes going through the training is a lot faster than having to ask questions one by one. If you did these training resources already I apologize, but it sounds like maybe you haven't.

 

ThomasHamill
Occasional Contributor II

@BillBlythe you could also put a calculation in a secondary text entry field named something like "Compliance" or "Compliance Status," as shown in the images attached below.  You could even make this read only or hidden when it populates Compliance/Not Compliant based on the first yes/no answer.

There's more detailed info on this Survey123 Blog Post called, "The art of hiding:"
https://community.esri.com/t5/arcgis-survey123-blog/the-art-of-hiding/ba-p/898454

ThomasHamill_0-1626699737336.png

ThomasHamill_3-1626699924062.pngThomasHamill_4-1626699959636.pngThomasHamill_5-1626700063491.png

 

 

Kindest Regards,

t
AllisonHollier
New Contributor III

And that is yet another idea I hadn't thought of.  Nice!

 

BillBlythe
New Contributor III

if(selected(${ClearSpaceOverlap},'Yes'),'Not Compliant',if(selected(${ClearSpaceOverlap},'No'),'Compliant',"))

What am I missing here?  typed it in and gives me an error.

BillBlythe_1-1626712849351.pngBillBlythe_2-1626712854333.pngBillBlythe_0-1626712802309.png

BillBlythe_3-1626712926967.png

BillBlythe_4-1626712971330.png

Todd

 

 

 

 

 

AllisonHollier
New Contributor III

I don't think you need the second part of this.  It's an "if/else" calculation.  The first part is "if this,this, else that.  So in instance below, 'Not_compliant' is what would be chosen if yes is selected, 'Compiant' is what would be selected if the answer is no is selected.  

if(selected(${clearspaceselected},'yes'),'Not_compliant','Compliant')

Here's the documentation on the formula 

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

And another question from this forum where someone used multiple choices...

https://community.esri.com/t5/arcgis-survey123-questions/if-statement-calculation-survey123/td-p/807...

Let me know how it works out for you, Bill.  I'm curious to see what you come up with.

ThomasHamill
Occasional Contributor II

@BillBlythe, the if expressions vary slightly in how they print a result in the secondary "Compliance Status" text field if the user skips or leaves blank the initial select_one yes_no question.

Using the following expression from @AllisonHollier, the secondary "Compliance Status" text field will be populated with 'Compliant' even if the initial select_one yes_no question is left blank.

if(selected(${ClearSpaceOverlap},'yes'),'Not Compliant','Compliant'))


Using the following "nested if" expression, the Compliance text field remains empty (see ending else argument of '' empty single quote) if the user doesn't select either 'yes' or 'no' for the first question (skips or leaves it blank).

if(selected(${ClearSpaceOverlap},'yes'),'Not Compliant',if(selected(${ClearSpaceOverlap},'no'),'Compliant',"))

So you have a couple options there for choosing how the Compliance Status field is treated.

Kindest Regards,

t
AllisonHollier
New Contributor III

Definitely bookmarking this post!  Thanks, Thomas...  

BillBlythe
New Contributor III

Thomas

I have typed this in and keep getting an error.  I am so sorry to keep bugging you, but what you did would be great and I just need to be able to get it. 

Allison gave a great way, but when I do this to another yes/no question I get a problem because it shows a not compliant box where there is no question.  The question is based on a question above.

BillBlythe
New Contributor III

Hi Allison

This is so close, it works for yes and I do get compliant, but when I hit no, nothing comes up.

So close here and I get the feeling it is something small.

 

Todd