cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
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

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
Community Support
Community Support

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.

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?

 

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.

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

 

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.

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.

'

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
Microsoft Ignite

Microsoft Ignite

Join digitally, March 2–4, 2021 to explore new tech that's ready to implement. Experience the keynote in mixed reality through AltspaceVR!

New Super Users

Meet the Power Automate Super Users!

Many congratulations to the Season 1 2021 Flownaut Crew!

Microsoft Ignite

Microsoft Power Platform: 2021 Release Wave 1 Plan

Power Platform release plan for the 2021 release wave 1 describes all new features releasing from April through September 2021.

MPA Community Blog

Power Automate Community Blog

Check out the community blog page where you can find valuable learning material from community and product team members!

Users online (20,897)