Friday, January 6, 2023

PowerApps to PowerAutomate Integration - Connections!!

 When we integrate Power Automate flow with a PowerApp, by default the connections configured (run by user's) at powerapps will be passed on to Flow. 

For example, if we send email through Flow and its configured using service account, but when  the flow triggered from PowerApp, it passes the App running user's connection and email would be going from the user's account, not service account.  Similar thing would happen for other connections too.

There might be cases where we don't want this and the solution we follow in general is create a child flow and pass params to it from the main flow. Child flow uses configured connections as no connections are passed on to child flow.

But now, we do have much easier solution to this problem. It is with PowerApps V2 trigger. 

Using this new trigger, we get the ability to Impersonate actions / run activities with different user from Power Apps.

Once a flow is configured using new trigger, on the detail page, to the left bottom we would see "Run only Users" section. Click on Edit

This will provide option to update the connections to use for each type of connected we configured. By default they are set to "run-only user". We can change it to the connections we have in the flow.  


With this, for above example all emails triggered would be from service account only. We can repurpose this for other type of connections too like inserting data to SharePoint / read data from SharePoint even though end user doesn't have access on it.







No comments:

Post a Comment