Select to view content in your preferred language

Quick Tip: Keeping the ArcGIS Connectors for Power Automate Refresh Token Valid

445
0
06-30-2024 01:27 PM
SeanKMcGinnis
Esri Contributor
9 0 445

Power Automate allows us to automate a variety of tasks. But some flows don't run every day, they may only run once or twice a month. If the connection isn’t used by triggers or actions in other flows, the infrequent execution can introduce an issue. The refresh token that allows us to get a new token is only valid for two weeks. Here is a tip I use to keep my connections valid – create a flow that runs on a weekly basis and queries a feature layer. This uses the connection and will get a new refresh token and prevents it from timing out.

Steps

1. Build a scheduled clod flow that runs once a week at a specific time

Setting up a scheduled flow that will run once a week.Setting up a scheduled flow that will run once a week.

2. Add a ‘Get data from feature layer’ action and set it up to query a feature layer using the ‘Where’ advanced parameter with the query of ‘1=1’ and not return the geometry to reduce the size of the result set. The ‘1=1’ query will return all the records in the feature layer.

NOTE:  You can use whatever query you would like. I use the ‘1=1’ query, it will run against any feature layer without knowing any information about the data structure of the feature layer.

Querying a feature layer will use the connection and get a new refresh token.Querying a feature layer will use the connection and get a new refresh token.

 

In the end, you will have a simple two-step flow that keeps the connection valid and allows the flow to keep running and not throwing an error due to an invalid connection.

Simple flow to keep your connections valid.Simple flow to keep your connections valid.