We capture a lot of photos with Survey123 and I would like to include those photos into emails that I send to various people to help them better understand what the issue is that we are capturing. The emails I send are generated with Power Automate and the Survey123 connector. As of yet i have not had any success in figuring out how to use Power Automate to attache images to the emails. Any assistance would be greatly appreciated.
The workflow is not particularly straight-forward.
If you are using a secure survey:
Test and go.
If you are using a public survey, the instructions are slightly different.
If using a public survey, you do not need to worry about the token at all, so you do not need to add the portalInfo group into the payload, or add the token as a query to the HTTP module.
However, you need to make sure the permissions in the field_worker view are set to allow anonymous users to query ALL features, otherwise you will get an attachment in the email with no content.
Note: Since Survey123 allows you to capture multiple photos with a single image question, the webhook payload includes an array of attachments. For this reason, Automate will automatically create an 'Apply to Each' component in your workflow. This is not shown in the screenshots above but you will see it in Automate when you go through the steps. You may want to limit the number of attachments to be sent to 1 to keep things simple.
Note: The instructions above ONLY work if you publish the survey with 3.10 or newer. If you use the Survey123 field app to submit data, make sure the version is 3.10 or newer too.
Ismael,
Thanks for getting back to me so quickly. I’ll see if I can get this working!
Thanks a lot Ismael, the above post was very helpful! You are the best as always!!!!!!
Hi Ismael, thanks for the example! I followed the example that was shown here but I still get the message, "Token Required." Is there something else that I could possibly be missing?
Thanks!
@IsmaelChivite
In our setup of Microsoft Automate the HTTP Action seems to be a PREMIUM feature to which we don't have access to. Are there other options?
Karl
@IsmaelChivite , I have up to 3 images in my survey and I can get the images to show up in the body of the email, but if all three images aren't there (i.e., only one image was uploaded), the email does not send. I am using a table and getting the image to appear by referencing each URL (<img src="@{items('Apply_to_each')?['url']}">) in a table column. Any idea why it fails if all three are not there? I would have thought it would have just been a blank cell in the table.
Hello Karl,
Any luck how to get it working without Premium?
We do have a organizational policy limitation.
Any help.
Thanks,
Les membres connectés peuvent publier, suivre les mises à jour, et plus encore. Nouveau ici ? Inscrivez-vous gratuitement.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.