Select to view content in your preferred language

How to pull information from other rows in survey123 report - eg inspection history on outputted report

394
6
3 weeks ago
Carrie2025
Emerging Contributor

I hope you can help me out with a problem - I have a layer that represents stormwater retaining ponds and they get inspected every so often - So I set up a related inspection table that is linked by an id field.  So for each polygon, you can have many inspections records in the related table (1 to many relationship)

Now a formal report is needed for each inspection - I've got most of the report figured out but I can't figure out if its possible to include a history of the previous inspections.

basically, I'm looking for something like this:

Current Inspection Info:

user, date, weather, wet/dry, comments, next steps, etc etc...

than the history at the end

___________________________________

Inspection Date | Observations | Status

12-1-2024 | Good | initial Review

1-25-2025 |  Poor  | In Review

3-15-2025 | Good | Final

__________________________

Ultimately, it would list out every inspection in the related table done on that pond with a few details from that record.

Thank you for your help - Carrie 

Tags (3)
0 Kudos
6 Replies
Neal_t_k
Frequent Contributor

This might be what you are after:

https://doc.arcgis.com/en/survey123/browser/analyze-results/featurereport-repeats.htm

Short answer is anything in a repeat table needs to go inside a start and end tag: e.g.

${#Inspection_Details}

Fields from inside the repeat here

${/}

Carrie2025
Emerging Contributor

I've looked at the repeat table, but the problem is my survey won't have any repeats.  Each inspection is a separate row in a table, done at different times - the times can be months or days apart, depending on the inspection result.  

In the inspection report, I want it to list the details of that inspection, but than also have a table in the word template that gives an overview (date and result) of all previous inspections done on that site.

0 Kudos
Neal_t_k
Frequent Contributor

Maybe this will help then?

https://community.esri.com/t5/arcgis-survey123-blog/survey123-tricks-of-the-trade-summary-sections-i...

https://doc.arcgis.com/en/survey123/browser/analyze-results/featurereportqueries.htm

I am a little confused from your description on how your feature layer is set up.  Is the Current inspection in the same table/feature layer as the historic inspections, or do you have your current inspections and historic inspections in two different features that are related?  How did you build the feature layer, did you build them from Survey123 Connect?

0 Kudos
Carrie2025
Emerging Contributor

There are two parts to this , a polygon table showing the storm pond info, and than a related inspection table, connected by GUID.  The Arcgis survey is based on the related table.

As for the repeats, it looks like you have to have a repeat in the survey, but unless you could reopen the survey to add the repeat (and do it as many times as needed), its not going to work  I also don't see this type of workflow working for my end users.  My current workflow is that a webmap is opened, click on a feature, a popup with a link passing the GUID is sent to survey123, and then the technician would enter in the inspection data and it gets added to the related table.  

I looked at the Summarize Data section - problem was, it only showed the information for the selected parcel, not all the parcels matching the GUID.  It is possible that I'm missing something in that, I'm still working my way through this.  If you have any suggestions on the syntax- I'm willing to hear it.

0 Kudos
Neal_t_k
Frequent Contributor

I believe, but not positive as I haven't done it, but for the summary to work, when you are in the S123 data page, you have to select all the applicable rows, and then the summary section will work, that selection is not automatic.

However, you may be able to make a python script to automate that process?

https://developers.arcgis.com/survey123/guide/create-reports-using-the-arcgis-api-for-python/

0 Kudos
Carrie2025
Emerging Contributor

Thank you for the help!  Your answer is what I was thinking, I already have the python script created that takes the newest entry, and creates the report in PDF and attaches it back to the table.  Eventually it will be set to run with a webhook/task when a new submission is submitted.  And it shouldn't be that hard to add a second part for this, even possibly using a second template.  

0 Kudos