Hello. I am new to the community and apologize if this has been covered. i am trying to figure out how to attach multiple images and multiple files that come from survey123 to an email geberated via a webhook MS Power Automate.
Hey @ChrisRoberts
From your Survey123 connector, it should send over basically a list of these attachments. This post here should cover everything you need to know! https://community.esri.com/t5/arcgis-survey123-blog/survey123-tricks-of-the-trade-working-with/ba-p/...
Cody
Here's an example of my workflow. When a new record is submitted, it exports a report and then for some files that can't be included in the report, exports those as attachments. This uses the ArcGIS connector and not the Survey123 Connector in Power Automate. It may work with the Survey123 Connector, but I'm not sure.
You need to initialize an empty array variable to eventually store the Name and ContentBytes that you need to get the file into the email.
You need a For each loop function to get all your attachments. To do that, set the output from previous steps to use the feature attachments from when the survey response is submitted.
In the loop add the function from ArcGIS > Get Attachment. Set the parameters as follows
Layers in: My Content (your location may be different)
Feature layer: Select your feature layer name
Attachment: item()?['id']
Object ID: feature result objectid (selected from the dynamic content of when a survey response is submitted)
Then you need an Append to Array Variable function in the loop.
Parameters I used are
Name: Email Attachments
Value: {
"Name": item()?['name'],
"ContentBytes": Body (from the Get Attachment Function)
}
That is the last part of the loop. Outside of the look use Send an email (V2) function and in the attachments box insert the variable name for the array that we set earlier "Email Attachments" it should now include all the attachments from that particular record as attachments in an email. Just be aware of file sizes, if you're attaching photos, most emails can accept 20-25mb and that will get used up very fast with photos.