Forum Discussion
john john
Feb 25, 2022Iron Contributor
Power Apps to run scheduled calls to custom connector, is it designed for this type of applications
We have created a custom connector, which do the following:- 1) Get all the accounts from external system. 2) Get the account details by passing the Ids returned from step one. Then inside the P...
Micca0815
Mar 01, 2022Iron Contributor
john john
How about the following setup?
- Context variable to specify a timer duration (reflecting the user input for scheduled refresh time)
- on timer end, trigger the Flow
- Context variable for a hidden toggle value (as trigger for the data source refresh)
- UpdateContext to false before the Flow run, set context with the Flow run (should return true by default in case the Flow run succeeded)
- onTrue of the toggle, perform any refresh within the app
- Within the Flow built two arrays of items with the same pattern of properties, one for the returned users, one for the Sharepoint items
- Then loop thru all items from the Sharepoint user array and check if the current item exists within the returned account ID array.
- if not append the user ID entry to another array for processing in a later step
- Bonus: do it the other way around as well, to figure out which SharePoint entries might be obsolete
- Then loop thru all items from the Sharepoint user array and check if the current item exists within the returned account ID array.
- With the returned array of to be added account IDs, you now can either add all entries one by one, with concurrency enabled or by building a batch request.
The performance might depend on the total amount of records to process.
You could tweak the duration slightly also, if you make use of a compose action and access its items outside of the apply to each , instead of an append to variable action within the 'loop'.