Survey 123 Report Template Location Coordinates

192
3
2 weeks ago
GaylynFlowers
New Contributor

Hi, I am new to Esri. I have been searching how to add location as coordinates in the report. When I export the data as excel, it has the coordinates as "x" and "y". But when I tried using this syntax, I have the error message "Failed to parse ${location | getValue:"x"} since location cannot be found in the current parsing scope." 

Can someone please help? Thanks

0 Kudos
3 Replies
abureaux
MVP Regular Contributor
  • Generally speaking, when you create a Feature Report, you can only reference fields you add to your survey yourself. A few exceptions exist for fields that Esri automatically adds to all published surveys (e.g., ObjectID).
  • When referencing fields in your survey, you must reference the field name. To get a field name you can either open the XLSX and look in the name column, or go to the Schema tab in Connect and look in the Fields column (note: if using this second approach, you many need to swap between layers/tables using the Layyers/Tables column).
  • The fields x, and y are a little odd. They always exist, but you can't call upon them in Feature Reports. (I feel like this is a deficiency and should change). Adding ${x} to your Feature Report will result in the error you saw, even though you can see x and y as columns when you export data.
  • If you add a geopoint to your survey, you can reference it and pull data as needed. In my case, I added a geopoint called ${fred}.
    abureaux_0-1713292728806.png

To use ${fred} in a Feature Report, I have a few options:

  • ${fred} will result in an image being added to the Feature Report with the location.
    Result is:
    abureaux_1-1713293632754.png
    This is pretty useless most of the time.
  • ${fred | mapSettings:””:5000} zooms to a scale of 1:5000.
    Result is:
    abureaux_2-1713293642784.png
    Much better!
  • ${fred | getValue:"x"} will result in the x value being printed.
    Result is:
    -113.54919999999998
    This is pretty useless most of the time.
  • ${fred | getValue:"x" | round:3} Rounds to 3 decimal places.
    Result is:
    -110.301
    Much better!
  • ${fred | mapSettings:”667de8a61b50499f96ae11c3fb7aa6ff”:5000 | size:350:350} Uses a specific basemap, sets the scale to 1:5000, and sets the images size to 350:350. This is the best way to display a geopoint IMO.
    Result is:
    abureaux_3-1713293913736.png
    ${Fred} is looking beautiful now!

     

If you are curious where the map ID comes from (e.g.,667de8a61b50499f96ae11c3fb7aa6ff), you can either get that from any map you publish to your Portal, or from the Living Atlas. Just go to the map and copy the Map ID from the URL bar. E.g.,

abureaux_5-1713293994387.png

 

0 Kudos
GaylynFlowers
New Contributor

Hi,

Thank you so much for the explanation. Could you please help me to take a look? I am still having the same error even though I pulled with the same name from XLSForm.  

GaylynFlowers_2-1713988739031.png

 

GaylynFlowers_1-1713988690257.png

 

0 Kudos
abureaux
MVP Regular Contributor

Any chance you can upload the DOCX and XLSX files? That would help.

I see you swapped between upper and lower case in the XLSX. You will also need to match case. As such, the first screen cap of the lower case "location" properly matches the lower case "location" in your Feature Report parsing error.

And just to confirm. In Connect, when you go to the "" tab, do you see "location"?

abureaux_0-1713989438261.png

If you don't see "location" in this list, here are some common issues:

  • You forgot to republish your survey, meaning "location" isn't in the Feature Layer yet.
  • You set bind::esri:fieldType to "null", meaning "location" will not be added to the Feature Layer.
  • Your field is located within a repeat. While "location" has been added to your Feature Layer, it was added to a related table, meaning you need to reference it differently in the Feature Report.
0 Kudos