Send e-Mail (webhook) based on state where polygon was drawn in?

04-30-2020 05:24 AM
New Contributor III

I think I might have a pretty slick idea on where to implement Survey123 in our company, but I'm not sure if this here we go:

1.) let's say you have an editable hosted feature layer where you can draw some polygons to indicate an area. This polygon is drawn on a map consisting of polygons that represent state boundaries.

2.) now I want to create a custom web form that's based on Survey123 to use webhooks (MS Power Automate)

3.) I don't know if it's possible to include own web maps in my survey or if I have to use the map option in Survey123 Connect, but I want to send an autom. e-Mail to a specific set of e-Mail addresses based on where the polygon was drawn. For example: I have someone draw a polygon in New York, and upon submitting the form, a predefined e-Mail is sent to different New York based e-Mail addresses. If someone else draws a polygon in Texas, the e-Mail will be sent to some Texas based e-Mail addresses.

Is there a way to accomplish this? So basically quarry the underlying state with my polygon geometry to set the recipient of this web form.


0 Kudos
1 Reply
Esri Notable Contributor

Hi Ekrem Canli‌  I have personally not tried this in Power Automate, but I did in Integromat and it works pretty good. Technically this can also be done in Power Automate. Essentially, you can add to your flow bits to make HTTP requests to the ArcGIS REST API and do the basic steps you need: do a spatial query, get back results and then parse the results to trigger the next action.

I recently created a scenario as shown below where the incoming feature from Survey123 was used in a query against a polygon layer. If a polygon intersected with the geometry of the incoming feature, a new HTTP call was issued to update the attribute of the Survey123 feature with the identifier of the intersecting polygon.  This overall, is quite close to what you want to do, except that in your case you will send an email.po

Since you will be using Power Automate, I would start with the following:

Again, this is totally doable in Microsoft Power Automate. Hopefully someone else can give you more specific directions for Automate, or may be soon you will share with all of us how you did it!