Select to view content in your preferred language

Survey123 Reports - Map failing to generate following 'if' statement

334
0
11-13-2023 04:41 AM
natureGIS
New Contributor

Hi, I have created a Survey123 form for habitat recommendations. The survey is split into habitat types (coded as repeats) with the option of inputting text recommendations and then mapping them. I then created a Survey123 report template to export this information.

The report worked perfectly apart from when text is included but there is no map. I got an error when trying to generate the report as it tries to add a map even when there isn't one.

I then created a work-around by adding an extra question - 'Mapped?' (Would you like to map this recommendation?) and then coding the map in the report with an 'if' statement so that if this is ticked, the map appears in the report and if it is not ticked, the map does not generate. This works perfectly fine when there is no map created in the survey (i.e. it exports the text and no map), but fails when there is a map created. Any ideas why this happens and how to resolve it?

An example of my coding is included below:

AnonymousUser_1-1699879232968.png

I then used this coding in the report:

 

${#woodlandplantingaction}${if woodlandsuggestions}Proposed Woodland Planting

${photofwoodlandplanting | size:400:0}

${if shownfmwoodlandmap}Map

${woodlandplantingmap | mapSettings:"a972aac6921a4142b10296b395768f61"}${/}

${if woodlandsuggestions}Suggested Woodland Planting

${woodlandsuggestions}${/}

${/}${/}

0 Kudos
0 Replies