Select to view content in your preferred language

Pull Attached PDF into Survey123 Report

690
9
04-01-2024 07:05 AM
MT_JenAmes
Regular Contributor

Last I checked, Survey123 Report templates were not able to pull PDF attachments into a feature report. While this is disappointing, I have accepted it. However, I'm wondering if there's a different way to access the files that are attached to feature layers. I've noticed that PDF names don't even appear on a feature report, and I don't know if this is just because they're PDFs or if it's how those PDFs get attached to the feature that make the file name not show up in a report. Unfortunately, they're not always PDFs that are attached through a file question in a Survey123 form, regularly they're attached to the feature layer either using Field Maps or using editing widgets in an EB app.

Currently I have a Make scenario set up that emails a feature report upon request, but my end users are not happy with that those reports don't include any PDFs that are attached to the feature layer, and that they have to go fetch the PDFs themselves when they're needed. They use these feature reports to generate invoices, and the attached PDFs are important, as they often are an invoice from a 3rd party that we need to then add into our invoice.

Any suggestions of how I can easily get my end users their PDFs??

0 Kudos
9 Replies
RobertAnderson3
MVP Regular Contributor

I think the way I would go, because you're emailing it already, would be to query the layer and attach it to the email as well. The two links below are for Make and Power Automate for attachments in Survey123. Though as you said they can be attached after via Field Maps or ExB, but hopefully the way it's querying the layer for attachments can set you on the right path.

Blog post for Make (formerly Integromat, though this post hasn't been updated in a while so I'm not sure if there would be changes): Working with Survey123 attachments in Integromat (esri.com)

Blog post for Power Automate (which is updated pretty recently): Working with Survey123 attachments in Microsoft Power Automate (esri.com)

I am not very familiar with Make, but in Power Automate for ArcGIS there are triggers for when an attachment is created or edited, or if you flow is manually triggered you can include actions to query the layer for attachments, I would then just attach it to the email as well as the created feature report. Perhaps Make has similar elements?

0 Kudos
abureaux
MVP Frequent Contributor

I'm not proficient in Make anymore (haven't used since Integromat), but in I have a similar workflow in Power Automate .

As you stated, you can't incorporate PDFs into Feature Reports with Esri's process.

In my case, all attachments are fetched from the Portal and attached to the email as separate attachments. I assume Make has an equivalent method of retrieving attachments from Portal, so I'd start by looking for that (here is a start).

In Power Automate at least, you could take this one step further. If you detect a PDF, you can generate a Feature Report, download the PDF attachment, and then use an external service (within Power Automate) to merge the two documents into one. Again, an equivalent may be available for Make.

RobertAnderson3
MVP Regular Contributor

I was thinking if they wanted a single PDF there might be a solution in the webhook world, that would be handy (though your "external service" link is broken).

0 Kudos
abureaux
MVP Frequent Contributor

odd. The service is through Plumsail. Here is another link. https://plumsail.com/docs/documents/v1.x/flow/how-tos/documents/merge-pdf-files.html

0 Kudos
RobertAnderson3
MVP Regular Contributor

Oh awesome, thank you! I think you just pasted the wrong thing when making the first URL haha.

0 Kudos
abureaux
MVP Frequent Contributor

I inspected my original post and the link was all messed up! Oh well.

I knew the link I found looked odd from what I remembered. Seems there are two Integromat/Make posts by Ismael around the same date. The content appears generally the same. The only difference I saw was mine had a link to a Youtube video. Seems odd that this was omitted from the other blog post.

MT_JenAmes
Regular Contributor

Thanks all for your input. I believe I've tried the iterator method before, but unfortunately, this is a scenario triggered by Field Maps, not Survey123. It appears that attachments aren't accessible through the Field Maps trigger, only the geometry and attributes. My end users are (currently) not editing features in Survey123, so any edits made through Field Maps or an editing widget won't cause the scenario to run if I use Survey123 as the initial trigger.

Also I don't use Portal, just regular old ArcGIS Online storage.

0 Kudos
RobertAnderson3
MVP Regular Contributor

Sorry we weren't able to offer any help! These triggers are available in Power Automate, which would mean any time the feature layer is touched, from Survey123, Field Maps, Online Map Viewer, whichever, that the webhook would be triggered to run the actions.

RobertAnderson3_0-1712242962270.png

 

Or if you have a manual trigger there are actions to grab the attachments at the time as well.

RobertAnderson3_1-1712243291429.png

 

I see yeah it is only the Field Maps one in Make, odd. Does the 'edited' for Watch Features not count if it was an attachment? Or can Make not interact with the attachments on a feature layer at all?

Maybe you can use an HTTP call to the layer? I've seen that used for attachments before in Automate as well.

0 Kudos
MT_JenAmes
Regular Contributor

It appears that Field Maps just does not interact with attachments at all, which I believe means I wouldn't be able to use HTTP to pull an attachment if I'm using a Field Maps trigger, because there's no files or URL to pull from.

MT_JenAmes_0-1712330951154.png

I've used HTTP to pull attachments when I have the Survey123 trigger, but it appears the Field Maps trigger is just limited by comparison for some reason.

Personally, I don't like Power Automate. Despite knowing it's much more powerful, I just find it incredibly complicated and confusing compared to Make. Plus with many of the more powerful Esri tools behind a paywall of a Premium license, that was another huge factor for me not moving forward with forcing myself to learn it. My IT dept tried to get me a Premium license and our Microsoft licensing company just never gave it to us. That part is nothing against Esri and their tools, more against the weird licensing methods Microsoft uses. But it was a huge roadblock so I just gave up and stuck with Make.

0 Kudos