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 / How to send an email t...
Power Automate
Unanswered

How to send an email to the person who triggered the flow

(0) ShareShare
ReportReport
Posted on by 9

Hello,

 

I have a basic flow that is triggered from a SharePoint Online Site Design. It is basically:

When a HTTP Request is Received -> Create Azure Automation Job -> Send an email notification (v3).

 

The issue I have currently is that the "Send an email notification (v3)" task has the "To" field hard-coded. This should ideally be dynamic based on the user who triggered the flow (or in this case who triggered the SharePoint Site Design on the given SharePoint Site).

 

Appreciate any ideas, many thanks.

 

Categories:
I have the same question (0)
  • v-litu-msft Profile Picture
    on at
    Re: How to send an email to the person who triggered the flow

    Hi @Uros_SP,

     

    Could you get authorization When an HTTP Request is Received?

    If there is any information about the user in the output of the trigger, you could use the Parse JSON action after the trigger to extract information about the user.

     

    Best Regards,
    Community Support Team _ Lin Tu
    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

  • Uros_SP Profile Picture
    9 on at
    Re: How to send an email to the person who triggered the flow

    Hi @v-litu-msft ,

     

    Thanks for getting back to me.

     

    Not sure what you mean by "Could you get authorization When an HTTP Request is Received?"  there is no option for me.

     

    I followed the Microsoft guide here to trigger my Flow from a SharePoint Site Design / Site Script. 

     

    My SharePoint Site Design, Site Script, that triggers my flow looks like this: (from the same link above)

    {
     "$schema": "schema.json",
     "actions": [
     {
     "verb": "triggerFlow",
     "url": "[paste the workflow trigger URL here]",
     "name": "Record site creation event",
     "parameters": {
     "event":"site creation",
     "product":"SharePoint Online"
     }
     }
     ]
     }

     

    Do you know if there is anything I can do to edit the above SharePoint Site Design Site Script to get the current logged in user's email?

     

    Or can this be done from within Flow?

     

  • v-litu-msft Profile Picture
    on at
    Re: How to send an email to the person who triggered the flow

    Hi @Uros_SP,

     

    There is no information would be passed to Flow in the HTTP request to create a site, so it's no way could find SharePoint creator.

    As far as I know, there is no way could get SharePoint site properties.

    Maybe PowerShell could help you:

    https://www.sharepointdiary.com/2018/02/find-who-created-site-in-sharepoint.html

     

    Best Regards,
    Community Support Team _ Lin Tu
    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

  • Uros_SP Profile Picture
    9 on at
    Re: How to send an email to the person who triggered the flow

    Hi @v-litu-msft ,

     

    The only way that I think PowerShell could help me is if I added a step to retrieve the User who created the Site in my Azure Automation Runbook which is triggered by the flow.

     

    Do you know if its possible to output a variable from my Azure Automation Runbook to be returned and available inside my flow via "Get Job Output"? (Or some other Flow action?)

     

    example.PNG

     

    Otherwise I have no ability to pass additional fields as it is a SharePoint Site Design and Site Script, which is a JSON Schema syntax that has no way of capturing the current logged in user and passing that through to the initial HTTP Request..

     

  • v-litu-msft Profile Picture
    on at
    Re: How to send an email to the person who triggered the flow

    Hi @Uros_SP,

     

    You could append the unique Job ID into the Get job output action:Annotation 2020-04-22 104244.png

     

    Best Regards,
    Community Support Team _ Lin Tu
    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

  • Uros_SP Profile Picture
    9 on at
    Re: How to send an email to the person who triggered the flow

    Hi,

     

    My solution in the end was to get the Site Collection Administrator's email and return that as text from my Azure Runbook PowerShell code to my Flow.

     

    Are you able to point me in the direction of some more detailed documentation around how Flow's various data transformation functions work? there seems to be limited documentation to explain how to parse JSON, extract values, etc. Is there a Flow Connector where you can just write C# or some other programming language to massage the data? the GUI is very confusing for doing this.

    '

  • Verified answer
    v-litu-msft Profile Picture
    on at
    Re: How to send an email to the person who triggered the flow

    Hi @Uros_SP,

     

    It's unfortunate that there is no connector could connect with C#.

    But I can give you some instance of parse JSON:

    http://johnliu.net/blog/2018/6/a-thesis-on-the-parse-json-action-in-microsoft-flow

     

    Best Regards,
    Community Support Team _ Lin Tu
    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

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