English

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.

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.

Procedure

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.

  1. In Microsoft Power Automate, navigate to My flows > New > Automated-from blank.
  2. In the Build an automated 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.
Image of the Build an automated flow window in Microsoft Power Automate
  1. 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.
Image of the When a survey response is submitted action
  1. Click New Step, and add the HTTP action.
    1. In the Choose an action window, search for and select HTTP on the Actions tab.
Image of the Choose an action window
  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.
Image of 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.
Image of 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 action 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.
Image of the Choose an action window
  1. In the Send an email window, specify the email address of the recipient, the subject, and the content of the email.
  2. 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.
  3. Click the Attachments Content - field, and select Body (the output of the HTTP action) to attach the survey’s photo attachment in the email.
Image of 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.
Image of the ArcGIS Survey123 website
  1. On the survey page, on the Settings tab, click Webhooks, and click Edit Image of the Edit button to edit the webhook.
Image of the survey page
  1. On the Edit webhook page, in the Event data section, check the Portal info check box, and click Save.
Image of 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.

Image of an automated email notification with the survey photo attachment included

Related Information

Last Published: 12/16/2020

Article ID: 000024579

Software: ArcGIS Survey123 3.9, 3.8, 3.7, 3.6, 3.5, 3.4, 3.3, 3.2, 3.11, 3.10, 3.1, 3.0, 2.9.Classic, 2.8