English
Continue in the app
Be The First To Get Support Updates
Want to know about the latest technical content and software updates?

How To: Include ArcGIS Survey123 photo attachments in an automated email notification using Microsoft Power Automate

Summary

When survey responses with photo attachments are submitted in ArcGIS Survey123, it is useful to include the photo attachments in an automated email notification instead of viewing the photo attachments on the Data tab of the ArcGIS Survey123 website. This article demonstrates how to configure a Microsoft Power Automate webhook to include ArcGIS Survey123 photo attachments in an automated email notification.

Note:
This method can create multiple emails, one for each attachment in the response. In this situation, a better method may be that described in the Esri Community blog: Survey123 Tricks of the Trade: Working with attachments in Microsoft Power Automate 

Before performing this workflow, ensure the following requirements are met:

  • A Microsoft Power Automate account with the capabilities to use premium actions is created.
  • The survey is published in ArcGIS Survey123 version 3.10 or higher.
  • Survey responses are collected from the ArcGIS Survey123 field app version 3.10 or higher.
  • The survey’s photo question is set as required to ensure the automation workflow runs successfully each time a survey response is submitted.
  • For public surveys, ensure the ‘Editors can see all features’ option is enabled for the SurveyName_fieldworker hosted feature layer view in ArcGIS Online.
Note:
Microsoft Power Automate is a third-party service. Esri is not liable for positioning inaccuracies, subsequent updates, errors, or omissions of data.

In this article, a survey response with a photo attachment is submitted in ArcGIS Survey123, and the photo attachment is included in an automated Office 365 Outlook email notification via Microsoft Power Automate.

Procedure

  1. In Microsoft Power Automate, navigate to My flows > New flow > Automated cloud flow.
  2. In the Build an automated cloud flow window, specify the Flow name.
  3. Under Choose your flow’s trigger, search for ‘Survey123’, and select When a survey response is submitted. Click Create.
  4. Under When a survey response is submitted, click the Choose a survey drop-down menu, and select the desired survey. In this example, a survey titled Photo Test is selected.
Selecting the survey for When a survey response is submitted action
  1. Click New Step, and add the HTTP action.
    1. In the Choose an operation window, search for and select HTTP on the Actions tab.
Add the HTTP action to the flow.
  1. Under HTTP, click the drop-down arrow of the Method field, and select GET.
  2. For the URI field, click the Enter request URL bar, and on the Dynamic content tab, select feature attachments <field_name> URL.
The HTTP action window
Note:
Steps 6 and 9 are not required for public surveys.
  1. For a secured survey, add a token query to the HTTP action.
    1. In the Apply to each window, click HTTP.
    2. In the Queries section, type token for the Enter key field, and type @{triggerOutputs()?['body/portalInfo/token']} for the Enter value field.
The Queries section
  1. In the Apply to each window, add the Send an email action.
    1. Click Add an action. In the Choose an operation window, search for ‘Send an email’.
    2. On the Actions tab, select the mailing connector. In this example, Office 365 Outlook is selected as the connector to send an automated email notification when a survey response is submitted.
    3. In the Send an email window, specify the email address of the recipient, the subject, and the content of the email.
    4. Click Show advanced options. Click the Attachments Name – 1 field, and select feature attachments <field_name> name to populate the name of the survey’s photo attachment.
    5. Click the Attachments Content - field, and select Body (the output of the HTTP action) to attach the survey’s photo attachment to the email.
The Send an email action window
  1. Click Save to save the flow.
  2. On the ArcGIS Survey123 website, enable portal info in the payload for the survey.
    1. Log in to the ArcGIS Survey123 website, click My Surveys, and click the survey with the Microsoft Power Automate webhook to view it.
Clicking My Surveys from the ArcGIS Survey123 website
  1. On the survey page, on the Settings tab, click Webhooks, and click Edit The Edit button to edit the webhook.
The survey page
  1. On the Edit webhook page, in the Event data section, check the Portal info check box, and click Save.
The Edit webhook page

The image below shows the survey’s photo attachment included in the automated email notification when the survey response is submitted in ArcGIS Survey123.

An automated email notification with the survey photo attachment included

Related Information

Last Published: 7/28/2022

Article ID: 000024579

Software: ArcGIS Online Current ArcGIS Survey123 Website Current ArcGIS Survey123 (iOS) Current