web
You’re offline. This is a read only version of the page.
close
Skip to main content
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / I need to add a button...
Power Automate
Unanswered

I need to add a button to a SharePoint page to send an email.

(0) ShareShare
ReportReport
Posted on by 457

Updated with partial solution.

I found that by using the trigger "When an HTTP Request is received" I can paste that URL into my button. Cool. Now I just need to figure out how to get the data from the person pressing the button. 

- - - - - - 

 

My thought was to create a flow in PowerAutomate so when a button is pressed it sends a pre-scripted email from the person pressing the button.  The directive is to confirm that someone has reviewed the page. 

 

I've tried using Manually Trigger a Flow but, even though I was able to get the URL for this button, it needs to open another page to 'run the flow'.   

 

I was also thinking about creating a Form to trigger this process but having the whole form on a page is not ideal.  

 

I've also considered creating a power app to embed on the page but I'm not sure about all that. 

Categories:
I have the same question (0)
  • Expiscornovus Profile Picture
    33,181 Most Valuable Professional on at
    Re: I need to add a button to a SharePoint page to send an email.

    Hi @anthonys123,

     

    Recently I suggested a similar type of approach in this thread:

    https://powerusers.microsoft.com/t5/Building-Flows/Get-User-Details-from-a-quot-When-a-HTTP-request-is-received/m-p/1939186/highlight/true#M213545

     

    You could add parameters at the end of your URL (&customparameter=value) which can be retrieved within the flow via an expression like:

    triggerOutputs()['queries']['customparameter']

     

  • anthonys123 Profile Picture
    457 on at
    Re: I need to add a button to a SharePoint page to send an email.

    So, am I correct in understanding the solution you're providing is for a SharePoint List? It looks like at the bottom of that thread you've directed them to a script editor to add a button to a Page. 

  • Expiscornovus Profile Picture
    33,181 Most Valuable Professional on at
    Re: I need to add a button to a SharePoint page to send an email.

    Hi @anthonys123,


    Yes, that is correct. In that other thread I originally proposed a button via column in the list (via column formatting and the '@me' string value). That's also what I am suggesting for you 😀

     

    However, the poster in that other thread asked if it was also possible to just have a single button instead of embedding it into the list (new requirement).

     

    That's why in the end of the thread you see the discussion about a different approach to meet that new requirement 😁

  • anthonys123 Profile Picture
    457 on at
    Re: I need to add a button to a SharePoint page to send an email.

    I'm sorry if I'm not understanding... you are offering a solution for a LIST when I'm asking about a PAGE and you already know that the solution for one is not the same as the solution for the other? 

  • Verified answer
    Expiscornovus Profile Picture
    33,181 Most Valuable Professional on at
    Re: I need to add a button to a SharePoint page to send an email.

    Hi @anthonys123,

     

    Yes, that would probably be the easiest approach for retrieving the emailaddress of the current person without any coding. That's why I suggested this approach to you.

     

    But you are right, it would not be exactly the same as that other thread.

     

    You do need to change it to your specific setup/requirements 😁

     

    Btw, you can place a list web part on a page and with column & view formatting you can format it as a single button (if you just use a single item in the list).

     

    Below is an example which hopefully clarifies why I think this approach is still suitable for your situation.

     

    1. I create a list called Single Button Click, only with the title column. Add one list item to it. Does not matter what title value you use. We are going to reformat it anyway with the txtcontent button in the column formatting.

     

    2. Add column formatting to the Title column. Use the json below.

     

     

    {
     "$schema": "https://developer.microsoft.com/json-schemas/sp/v2/column-formatting.schema.json",
     "elmType": "button",
     "style": {
     "border-radius": "5px",
     "margin": "5px 0px",
     "padding": "0px",
     "visibility": "visible"
     },
     "attributes": {
     "class": "ms-bgColor-themePrimary"
     },
     "children": [
     {
     "elmType": "a",
     "txtContent": "Click Me",
     "style": {
     "text-decoration": "none",
     "padding": "10px 0px",
     "width": "100%"
     },
     "attributes": {
     "href": "='https://prod-30.yourregion.logic.azure.com:443/workflows/workflowguid/triggers/manual/paths/invoke?api-version=2016-06-01&sp=%2Ftriggers%2Fmanual%2Frun&sv=1.0&sig=randomsig&username=' + @me",
     "target": "_blank",
     "class": "ms-fontColor-white"
     }
     }
     ]
    }

     

     

    3. Add view formatting to the All Items view (to hide the column headers and selection options). Use the json below

     

     

    {
     "$schema": "https://developer.microsoft.com/json-schemas/sp/v2/row-formatting.schema.json",
     "hideColumnHeader": true,
     "hideSelection": true
    }

     

     

    4. Place the list web part on the page and make sure you select your List and hide all the controls

     

    button_clickme.PNG

     

    The end result should look something like below on a page.

     

    button_clickm.PNG

     

    That being said, obviously feel free to go down the deploy custom web part with javascript approach, if you feel comfortable coding. And the above is still not what you are looking for?

     

     

    Happy to help out 😁

    I share more #PowerAutomate and #SharePointOnline content on my Blog, Bluesky profile or Youtube Channel
  • anthonys123 Profile Picture
    457 on at
    Re: I need to add a button to a SharePoint page to send an email.

    Nice. This little code snipet really made a huge difference. Thank you for the help. 

    {
     "$schema": "https://developer.microsoft.com/json-schemas/sp/v2/row-formatting.schema.json",
     "hideColumnHeader": true,
     "hideSelection": true
    }

     

     

  • D365_Community Profile Picture
    6 on at
    Re: I need to add a button to a SharePoint page to send an email.

    @Expiscornovus  I have tried your method and it's very nice but I have a question, when you click the button it opens a blank page to the user with the URL we have entered can we put a note or a message inside just not to confuse the user of what's this.

    And thank you for your effort.

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 462 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 456 Moderator

#3
abm abm Profile Picture

abm abm 243 Most Valuable Professional

Last 30 days Overall leaderboard