Survey123 Feature Report Help

567
6
07-17-2019 02:48 PM
DebsGray
New Contributor III

I know you can put if statements on the survey form fields, but I'm wondering if there is a way that only the populated fields show up in the generated feature report?

Currently, I have: 

What is the name of this location? ${if SiteName}${/}

Is there a way that the question in bold that I've put in my word template doesn't appear if Site Name is blank in the survey? Is there an if statement I can apply to the whole structure?

I hope this makes sense!

0 Kudos
6 Replies
IngridAldridge1
New Contributor III

Hello Debs,

I've done this type of setup in reports when using select one questions to filter sections of the report or individual questions.  I've never done it just with answered or not but I've tested this syntax today and it worked for me.  The condition you have looks correct but you can put it around the whole question as long as you qualify the response.  Format would be something like this:

${if SiteName != ""} What is the name of this location?    ${SiteName}${/}

DebsGray
New Contributor III

Hi Ingrid

This is exactly what I wanted, thank you so much!

0 Kudos
joerodmey
MVP Alum

Perfect! I will definitely make use of this

0 Kudos
DebsGray
New Contributor III

Hi Ingrid Aldridge

I've now tried that with photos and it doesn't seem to work, Photo #2 still appears even though there's no photo assigned to that field. Do you know if I need to change the syntax slightly?

Currently, I have:

${if Photo2 !=””}Photo #2 ${Photo2 | size:200:0}${/}

Thanks!

0 Kudos
IngridAldridge1
New Contributor III

Hi Debs,

You would definitely need to change the syntax.  I'm not 100% certain to what.  The photo is treated as an attachment and therefore there isn't actually a field.  The only way I've done photos that is similar is with a secondary field as well.  I always have a caption field with my photos so mine look like.

${if cap_photo1}    ${img_photo1 | size:300:0}${/}

That will put the caption before the image but only shows both if the caption has been filled in.

Sorry, I'm not sure what else you could do with the photo option.

0 Kudos
DebsGray
New Contributor III

Hi Ingrid

Ah I see what you mean, that's helpful, thank you!

0 Kudos