Report Creation via Make: Is there a way to generate individual PDFs for each record in a repeat?

841
2
Jump to solution
04-18-2023 02:07 PM
Vinzafy
Frequent Contributor

Hey all,

I'm a bit stumped with this process. Essentially I want to create a scenario in Make that generates an individual report for each applicable record pulled from a repeat.

Background

The data structure for this survey is a parent layer containing high level event details, and a repeat for attendance that records all attendees for the event (present as a repeat in the survey). The workflow desired is to create certificates using names from the "Attendance" repeat.

Though I can generate certificates for all attendees from the parent survey into a single, combined PDF, the desired workflow is to create individual PDFs so each attendee has their own certificate (credit usage isn't a concern here).

I have considered adding a "split PDF" module in the scenario, however it just splits the PDF with a generic name. Ideally, the PDFs would have customized filenames with their organization and name appended (e.g., ${event_date}_${first_name}_${last_name}_${organization}).

In order to achieve that, I believe I have to generate certificates from a survey where the submission URL and form ID are specific to the HFL and attendance repeat. This way, individual reports can be generated for all applicable attendees.

The way I envision doing this in Make is to watch a survey, push forward the parentglobalID, and then generate reports from the specific attendance repeat survey for all records that match the parentglobalID. I'm not entirely sure how to do this and I may be overcomplicating things.

Question

How would I go about generating individual PDF reports for each relevant record in a repeat? Can this be done in the parent survey itself? Or would I have to utilize a survey tailored to the related repeat table and generate reports from there?

Essentially what I'm aiming to do is create a scenario in Make that replicates this process where you can filter for specific records (parentglobalID in this case), then generate individual reports for each record with the filename tailored from the attribute table:

Vinzafy_0-1681851859008.png

The screenshot above is from the survey I created specific to the Attendance repeat, however if this process can be achieved via the parent survey, that would be ideal.

Any help is much appreciated!

Additional Context

For additional context, here's the current scenario I have in Make that gets me 90% of the way there. The last 10% is having it so that PDFs have custom filenames based on attendees, but I feel incorporating that last 10% will require changing the entire process.

Vinzafy_0-1681855793313.png

0 Kudos
1 Solution

Accepted Solutions
IsmaelChivite
Esri Notable Contributor

I think you are in the right track. You will definitively need to create a second survey targeting the related table. The trick, as you point out, is how to feed the Create Report tool with a Where statement so you can run a report for all records that match your parentGlobalID.  Unfortunately, you cannot specify a Where clause yet (although this is something we would like to add in the future).  So the only option left is to feed the Create Report action with an objectID.   This should be possible through the HTTP module. You will need to make a call with this module to the feature layer REST API and get back the ObjectIDs for your parentGlobalID. Then either use an iterator to generate reports for each ObjectID, or pass all ObjectIDs as a comma separated list to the ObjectID argument.   I am not 100% sure if passing the comma separated list will work. It will only work if the default policy for bulk reports is split. I am not sure if that is the case. Never tried it. In any case, you always have the option of using an iterator.

View solution in original post

2 Replies
IsmaelChivite
Esri Notable Contributor

I think you are in the right track. You will definitively need to create a second survey targeting the related table. The trick, as you point out, is how to feed the Create Report tool with a Where statement so you can run a report for all records that match your parentGlobalID.  Unfortunately, you cannot specify a Where clause yet (although this is something we would like to add in the future).  So the only option left is to feed the Create Report action with an objectID.   This should be possible through the HTTP module. You will need to make a call with this module to the feature layer REST API and get back the ObjectIDs for your parentGlobalID. Then either use an iterator to generate reports for each ObjectID, or pass all ObjectIDs as a comma separated list to the ObjectID argument.   I am not 100% sure if passing the comma separated list will work. It will only work if the default policy for bulk reports is split. I am not sure if that is the case. Never tried it. In any case, you always have the option of using an iterator.

Vinzafy
Frequent Contributor

Thanks so much for your response Ismael! Much appreciated. Great to know that this workflow can be achieved via HTTP module and REST API calls.

Admittedly, I'm still very new to the world of HTTP and REST APIs and not 100% sure how to setup the HTTP module to call the REST API. I did see this thread which outlines a similar workflow, however the details are barebones. I imagine a great starting point would be the S123 REST API Reference - featureReport page on the Developers site which I will read through today.

Once I'm able to create a successful workflow, I'll be sure to document and create a post outlining the process to help others with similar cases!

0 Kudos