Skip to main content

Notifications

Power Automate - General Discussion
Unanswered

Send email

(0) ShareShare
ReportReport
Posted on by 27
Hi everyone, 
 
I have run into a dilemma, and I wanted to see if anyone has a better solution. 
 
I am building a SharePoint site for our team, and I am trying to automate some processes to make life easier for everyone. I have a SharePoint list that's connected to an app built in Power Apps. I set up a flow that when an item is created on SharePoint list, to get a user profile from office 365, and send an email with the items from the SharePoint list. Where I am running into issues, is in the "Send an email" step, when other people submit an item on the app, it says they don't have permission to send an email on behalf of. 
 
 
Now the dilemma is that I don't have admin rights to our over all organization email so I can't go in and change the permissions globally. Is there a way I can get around this problem and have the flow send an email when a different user submits a form? please see below for the flow: 
 
 
 
 
 
 
 
Categories:
  • CU25100538-0 Profile Picture
    CU25100538-0 7 on at
    Send email
    Hi NahalB!
     
    I think you don't need Power Automate at all for this. I can't see your whole flow, but something to think about is adding all actions to the App, including the send an email. This will only work if people solely create new records from the App, if they do it on the List directly, it won't send an email and you will need to reply on PA.
     
    I assume your App has a gallery and an edit form or something like that? Basically, whichever control you are using to 'submit form' after the user has done their edits, you also add Office365Outlook.SendEmailV2 to the action. You don't need to give the user a compose field in order to send the email - you can pre-populate it into the formula including content they just added in the App. My only question would be WHO you are trying to email, because your original post is not clear. If they are a person-type column in the list, as long as they are added when the item is created, it should be straightforward.
     
    This way, there are no authentication issues, as it is sent 'from' the current user of the App (they will need to allow connection the first time they use the App).
     
    I see Korhanh below provided the same advice as I was typing! You can also check the Power Apps forum.
  • Korhanh Profile Picture
    Korhanh 15 on at
    Send email

    Hello,

    Normally, when the "Provided by run-only user" option is selected, the email should be sent by the creator.

    If this method is still not working, I recommend handling the email sending process directly through Power Apps. Please follow the steps below:

     

    1.Please add the "Office365Outlook" connection first.

     

    2.Then, insert your current setup into HTMLTEXT. You can use the following example:

    "<p>Hello,<br>
    I am requesting a/n <strong> " &TextRequestType.Value & "</strong> number to use for project # <strong>" & TextProjectNumber.Value & "</strong> - "&TextProjectTitle.Value&".<br>
    <br>
     
    <table>
      <tr>
        <td style='width: 15%;'><strong>Project Manager:</strong></td>
        <td>"&TextProjectManager.Value&"</td>
      </tr>
      <tr>
        <td style='background-color: yellow; padding: 2px;'><strong>Request Type:</strong></td>
        <td>"&TextRequestType.Value&"</td>
      </tr>
      <tr>
        <td><strong>Facility:</strong></td>
        <td>"&TextFacility.Value&"</td>
      </tr>
      <tr>
        <td><strong>Project #:</strong></td>
        <td>"&TextProjectNumber.Value&"</td>
      </tr>
      <tr>
        <td><strong>Project Title:</strong></td>
        <td>"&TextProjectTitle.Value&"</td>
      </tr>
      <tr>
        <td><strong>Vendor:</strong></td>
        <td>"&TextVendor.Value&"</td>
      </tr>
      <tr>
        <td><strong>Contract Type:</strong></td>
        <td>"&TextContractType.Value&"</td>
      </tr>
    </table>
    "
     
     


    3.Next, add a button and run the function using the code example below: 

    Office365Outlook.SendEmail(

        "huseyin_korhan@zetaleap.com",
        "Project #  "&TextProjectNumber.Value & " - " & TextRequestType.Value & " Request for " & TextVendor.Value,
        HtmlText1.HtmlText,
        { IsHtml: true }
    )
     

    Once these steps are completed, the user logged into Power Apps can directly send emails to the relevant contacts.

     

     

  • NahalB Profile Picture
    NahalB 27 on at
    Send email
    @David_MA looks like I don't have permission from the organization to adjust the users and set them as Run only users. 
  • David_MA Profile Picture
    David_MA 8,950 on at
    Send email
    You're not showing me what I would need to see to know if it were configured correctly. You need to:
    1. Share your flow with whomever should be able to run it.
    2. Go the flow details screen and click Edit on Run only users:
    3. Then make sure that the e-mail action is set to run with the Provided by run-only user credentials.
     
    If you did that, it is correct.
  • NahalB Profile Picture
    NahalB 27 on at
    Send email
    @David_MA if I take out the Power Apps altogether and go based off of SharePoint only, is this set up correct? 
     
  • David_MA Profile Picture
    David_MA 8,950 on at
    Send email
    NahalB I am not sure if changing the trigger to manual will work, since I don't do any Power Apps development, so I am not sure how you trigger the flow from your app. If you know how, it would be worth giving it a try. Just be sure that when you do, you have the e-mail action run on the credentials of the person who triggers the flow.  The e-mail will be sent from their mailbox instead of the flow owner.
  • NahalB Profile Picture
    NahalB 27 on at
    Send email
    @David_MA so if I change the automatic trigger to manual trigger, that would fix the email problem? sorry I am still new to the power platforms. Also would the manual trigger have to be manually pressed every time someone submits a response? 
  • Suggested answer
    David_MA Profile Picture
    David_MA 8,950 on at
    Send email
    I don't do anything with Power Apps, but I know what the problem is based on one of your screen shots:
    When you create a flow, the flow runs under the credentials of the person who is the owner of the flow. Like I said, I don't deal with Power Apps, but however you are triggering this flow from Power Apps, it is using the credentials of the person who submitted the item and they do not have permissions to send e-mails from the owner of the flow.
     
    If this were a manually triggered flow, you would set the connection on the e-mail action to run on the credentials provided by the user. For example with a SharePoint action:
     
    You may want to post your question in the Power Apps community instead: Microsoft Power Platform Community Forum Thread
     

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Microsoft Kickstarter Events…

Register for Microsoft Kickstarter Events…

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Announcing Forum Attachment Improvements!

We're excited to announce that attachments for replies in forums and improved…

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 145,475

#2
RandyHayes Profile Picture

RandyHayes 76,287

#3
Pstork1 Profile Picture

Pstork1 64,767

Leaderboard