Select to view content in your preferred language

Reverse geocode in Power Automate

318
8
Jump to solution
07-30-2024 09:22 AM
MatanBenYishay
New Contributor II

Hello,

I'm trying to use the Power Automate ArcGIS enterprise connector (or any ArcGIS connector) to reverse geocode some records (retrieved from a SQL server connection). I have an ArcGIS app set up and key from it.

I have not found an action for reverse geocoding. Is there one available? Or does this need to be written via a webhook or something else?

Reference: https://doc.arcgis.com/en/microsoft-365/latest/power-automate/actions.htm 

Thank you!

0 Kudos
1 Solution

Accepted Solutions
CodyPatterson
Regular Contributor

Hey @MatanBenYishay 

Here is a link that I had used when constructing the response capturing:

https://dev.thebotplatform.com/docs/how-to-set-up-and-use-webhooks-in-power-automate

The main idea would be to use the HTTP (Premium) connector to send a POST request out to your Enterprise Reverse Geocoder, and then when the response is received and captured by the "When a HTTP request is received" and then my a Response connector, this is an example of what it would look like here:

CodyPatterson_0-1722512168890.png

CodyPatterson_1-1722512176425.png

 

This is the gist here, test data within to provide a structure. Let me know if you need anything further!

Cody

View solution in original post

8 Replies
CodyPatterson
Regular Contributor

Hey @MatanBenYishay 

I encountered this same situation a few months back, it appears that there is not a direct way to reverse geocode using the ArcGIS connectors, so I had to create a custom webhook to reach out to my SQL server to perform this for me.

Cody

MatanBenYishay
New Contributor II

Thank you Cody. Are there any starting points you could point me to for this? I haven't written a custom webhook on Power Automate.

0 Kudos
CodyPatterson
Regular Contributor

Hey @MatanBenYishay 

Here is a link that I had used when constructing the response capturing:

https://dev.thebotplatform.com/docs/how-to-set-up-and-use-webhooks-in-power-automate

The main idea would be to use the HTTP (Premium) connector to send a POST request out to your Enterprise Reverse Geocoder, and then when the response is received and captured by the "When a HTTP request is received" and then my a Response connector, this is an example of what it would look like here:

CodyPatterson_0-1722512168890.png

CodyPatterson_1-1722512176425.png

 

This is the gist here, test data within to provide a structure. Let me know if you need anything further!

Cody

MatanBenYishay
New Contributor II

Thanks again. In the HTTP action with a POST method, I'm a bit stuck on authenticating. I'm trying to provide OAuth credentials based on an app that I've set up within ArcGIS online. I have the client ID and the secret from the app. I'm assuming that the tenant is in the form https://<myorg>.maps.arcgis.com.

I'm a bit stuck on Audience and Authority, however. I haven't been able to find much documentation on these. For Audience, I've tried "Viewer" and it didn't immediately throw an error. For Authority, I'm a bit stuck. It isn't marked as required, but it does throw an error when I test it.

Any ideas or documentation to point to as to how to proceed?

0 Kudos
CodyPatterson
Regular Contributor

Hey @MatanBenYishay

On the HTTP action on the POST method, are you entering the authentication on the advanced options? Some of my authentication takes place in the headers, but the authentication dropdown may be beneficial in this case. I also found this here which shows the request being used to grab a token which may be beneficial as well: https://stackoverflow.com/questions/59724395/oauth2-0-with-microsoft-flowpower-automate-and-then-acc...

https://forwardforever.com/using-oauth-authentication-for-http-request-triggers-in-power-automate/

Hope that helps!

Cody

0 Kudos
AnthonyLatini
Esri Contributor

Hello @MatanBenYishay @CodyPatterson ! This is a great post and is on our project boards for our upcoming release in November. Once it is released, you can make use of the ArcGIS Connector (PaaS, Online, Enterprise) and reverse geocode your values. 

When I have tested this thoroughly, I can provide a preview of a flow that contains the new actions. Keep an eye out on this thread for updates! 😎

CodyPatterson
Regular Contributor

Hey @AnthonyLatini 

Sounds great! Thank you for letting us know, it'll be a great addition!

Cody

0 Kudos
MatanBenYishay
New Contributor II

Great to hear it!

0 Kudos