Select to view content in your preferred language

Feature Report - Nested/Nested photolog how to get the nested photos only for summited record?

943
1
01-05-2024 12:31 PM
MichelleWilliamsERM
Frequent Contributor

I need only to pull the photos in repeat for the latest submission.

I used this code in other surveys, but it's not working as expected here ${if (EIH_PhotoLog | getValue:"count")>=1}

In this survey, the daily report is a nested repeat, and the photolog is nested again; things got complicated here.  

I've attached the .xlsx file and the feature report.

Here’s how to load everything if you need to work through it.

  • Publish with Inbox turned ON
  • AND turn OFF Sent Folder option
  • Complete two inspections; use the Inbox for the 2nd one.
  • Take a Environmental photo for each submission
  • Upload the feature report to AGOL/Survey123
  • And print
  • The photo prints for each (see PDF)

Thanks for any help you can provide. 

 

0 Kudos
1 Reply
abureaux
MVP Frequent Contributor

I have attached an XLSX. Your form was giving me anxiety with the names not typing in, so I had to move to a fresh template (sorry). But, I highlighted 3 fields that I added so you can see what's going on.

InspPosition is just your position within the main repeat.

abureaux_0-1704493864368.png

EIH_position (hidden) is a copy of your position within the main repeat for the nested image repeat. This way, you know when a photo was taken in relation to the main repeat. EDIT: It occurs to me that you will likely need to enclose the value in once() so it doesn't update old values accidentally.

abureaux_1-1704493901809.png

positionMax is simply the highest value of InspPosition (aka, the last repeat item).

abureaux_2-1704493948839.png

In the feature report, just use this:

${#EIH_PhotoLog | where:"EIH_position = positionMax"}${EIH_Photo}${/}

That should only print photos from the most recent submission. Though, can't say I spent too long going through your form, so I may have missed some function. If so, please let me know.