cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
stevegeall
Advocate II
Advocate II

Calling PowerAutomate from Powerapps - accounts used

Hi all,

 

Within a PowerApp, if you connect to a PowerAutomate flow to send an email; the email send action in the flow seems to run as the user logged in to the PowerApp. Is that correct?

 

For example:

 

  1. A PowerApp may have a button that runs a PowerAutomte flow passing across an email address, something like 'SendEmailAs.Run("name@email.com")'
  2. The PowerAutomate flow is initiated and contains a single action to send an email to name@email.com using the Outlook Send Email connector
  3. This connector is set up to run as a different account that has 'SendAs' rights on a shared mailbox. The Send Email action is also set to SendAs this different account.

If I test this PowerAutomate flow from within PowerAutomate, it works correctly - I'm guessing it's using the account set on the Outlook Send Email action to send the email.

 

If I use the PowerApp (logged on as a different user who doesn't have SendAs access for the mailbox set in the flow), pressing the button that calls the PowerAutomate flow, it fails with an error "no permission" - which leads me to think that the Outlook Send Email action is connecting as the PowerApp user rather than the user set explicitly on the Outlook Send Email action in the flow.

 

Is this how it is supposed to work?

 

Cheers,

Steve.

1 ACCEPTED SOLUTION

Accepted Solutions
RandyHayes
Super User
Super User

@stevegeall 

This is correct.  When you call a PowerAutomate Flow from PowerApps, it executes under the context of the User using the app.

If you need to utilize a send as from a shared mailbox account, then either the users of that will need send on behalf permissions or they will fail in the flow.

You can also offset this by, instead of sending the email in the flow, writing a record to a secondary SharePoint list with any relevant information (email body, to addresses, etc) and then have a separate flow set up to trigger on the creation of a new item in SharePoint for that secondary list.  That can then have its account set to have send on behalf permission and then it can grab the record and build the email.  Those triggered flows execute in the context of the creator of the flow.

 

I hope this is helpful for you.

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!

View solution in original post

3 REPLIES 3
RandyHayes
Super User
Super User

@stevegeall 

This is correct.  When you call a PowerAutomate Flow from PowerApps, it executes under the context of the User using the app.

If you need to utilize a send as from a shared mailbox account, then either the users of that will need send on behalf permissions or they will fail in the flow.

You can also offset this by, instead of sending the email in the flow, writing a record to a secondary SharePoint list with any relevant information (email body, to addresses, etc) and then have a separate flow set up to trigger on the creation of a new item in SharePoint for that secondary list.  That can then have its account set to have send on behalf permission and then it can grab the record and build the email.  Those triggered flows execute in the context of the creator of the flow.

 

I hope this is helpful for you.

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!

View solution in original post

Thanks mate, yep your suggestion is exactly what I ended up doing; was just hoping there was a way to achieve this outcome without using an intermediate SharePoint list.

 

Cheers for the reply!

Steve

Rohit4044041
Helper II
Helper II

is this true only for outlook connector or all the connector within power automate thats called from power app. i.e. i understand send email will user current logged in user acount and not flow author . But if we use "create sharepoint list item" within power automate which is called from power app, will that sharepoint item show as created by flow author or current logged in user? 

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Microsoft Ignite 768x460.png

Find your focus

Explore the latest tools,training sessions,technical expertise, networking and more.

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

Welcome Super Users.jpg

Super User Season 2

Congratulations, the new Super User Season 2 for 2021 has started!

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

Users online (1,532)