Field Maps attachments and Make/Integromat

698
6
05-18-2023 12:22 PM
MT_JenAmes
New Contributor III

I'm trying to set up a scenario in Make to send an email with all the attachments associated with a feature upon request. I'm not seeing a way to pull those attachments though, am I just missing something?

MT_JenAmes_0-1684437742928.png

0 Kudos
6 Replies
ChristopherCounsell
MVP Regular Contributor

Survey123 requires you to make a HTTP request to obtain them:

https://www.esri.com/arcgis-blog/products/survey123/field-mobility/working-with-survey123-attachment...

I don't believe Field Maps is any different, as the applyEdits payload doesn't have the information about the final location of an attachment, so you need to query the feature service after the photo has been attached.

0 Kudos
JustinColville
Esri Contributor

Using the Survey 123 Make module is a similar process to Field Maps, but there are a few small differences.

You can use the Field Maps Make an API Call module, to queryAttachments.  The module will take care of generating the token for the connection.

For a connection similar to below, where a sub-domain has been specified, you can then use a Make an API Call similar to the second image.  This will return a list of attachments for the specified feature, which you can then iterate through and make a second API call to retrieve the attachment data (screenshot 3 below) which you can then use.

JustinColville_1-1684533973742.png

 

JustinColville_0-1684533701104.png

JustinColville_2-1684534305055.png

 

ChristopherCounsell
MVP Regular Contributor

so the 'make an api call' module here uses the long-term token through the connection in Make? And that connection just needs access to the service?

Token handling with survey123 can get messy as if the Make scenario fails (e.g. no credits), the token in the payload from the survey submission expires. I guess this avoids all of this?

0 Kudos
JustinColville
Esri Contributor

Yes, the "Make an API Call" uses the connection to generate tokens that it needs.

"the token in the payload from the survey submission expires. I guess this avoids all of this?"

Yes, this would be different, as the "Make an API Call" is not relying on using the token from a previous response.

0 Kudos
MT_JenAmes
New Contributor III

Would you be able to give me a bit more detail on how to set up a scenario using the setup you've described? I'm not super familiar with this level of Make scenarios. 

My ultimate goal is to be able to generate a Survey123 report upon request, and send it in an email with all the attachments (PDFs and JPEGs). The problem I'm having is that  I want the report not to be generated from initial submission, but after edits have been made using Field Maps/webmap, and attachments then have been attached to the point, not to the survey. And also that Survey123 Reports apparently don't work with PDFs, only picture file types. So it's proving to be quite difficult above my current skill level to automate this process.

0 Kudos
LeviCecil
Occasional Contributor III

Is it in the road map to just make the attachments visible in the attribute list in the Field Map watch features module? It would be nice to include these in emails all within the same scenario.