cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Frequent Visitor

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

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.

 

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Community Support
Community Support

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.

View solution in original post

7 REPLIES 7
Highlighted
Community Support
Community Support

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.

Highlighted
Frequent Visitor

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?

 

Highlighted
Community Support
Community Support

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.

Highlighted
Frequent Visitor

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..

 

Highlighted
Community Support
Community Support

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.

Highlighted
Frequent Visitor

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.

'

Highlighted
Community Support
Community Support

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.

View solution in original post

Helpful resources

Announcements
firstImage

Super User Program Update

Three Super User rank tiers have been launched!

firstImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

firstImage

New & Improved Power Automate Community Cookbook

We've updated and improved the layout and uploading format of the Power Automate Cookbook!

thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

Top Solution Authors
Users online (7,354)