cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Gmma99
New Member

Get name of user who ran the Flow and add to Excel

Hi all, 

 

I'm using a Flow which is activated from a Teams message. The message user, message content, and today's date go into an Excel sheet.

 

I'd like to pull in the name of the person who triggered the flow, too. I thought this might be  one of the Dynamic Content items but I don't see anything obvious. I tried 'invokeName' but the Excel column remained blank after the flow finished running. 

 

I've included a screenshot of the Flow Teams fields. Everything else about the Flow runs perfectly and all other info we need comes in to the Excel sheet fine. 

 

Thank you!

Emma

Teams to Excel.png 

1 ACCEPTED SOLUTION

Accepted Solutions
Expiscornovus
Dual Super User
Dual Super User

Hi @Gmma99,

 

You are correct, I was pointing to the wrong field. My bad.

 

In that case you could use this expression instead. That should be the person who is triggering the flow.

triggerBody()['entity']['teamsFlowRunContext']['From']['Name']

View solution in original post

4 REPLIES 4
Expiscornovus
Dual Super User
Dual Super User

Hi @Gmma99,

 

You could use an expression to retrieve the From User DisplayName field (Sender User DisplayName) for that Saved by field if it doesn't show up in your list of dynamic content fields.

 

Edit: I see you were already using the Sender User DisplayName in the Staff Name field. Surely that is the person who triggers the flow, correct?

 

And if so, you can just search for that field in your dynamic content list and don't need to worry about an expression.

 

Below is an example of that field in a compose action (if the Sender Display Name doesn't show up in the dynamic content field list):

 

 

triggerBody()['entity']['teamsFlowRunContext']['MessagePayload']['From']['User']['DisplayName']

 

 

 

triggerbody_forselectedmessage.png

 

Gmma99
New Member

Thanks so much @Expiscornovus for your help. 

It's not always going to be the user who wrote the message as the same person who triggers the flow. It's a Team where there are 50 users trialling a piece of software. As they raise issues or beta findings, the support team would like to save those messages centrally (and avoid copying and pasting into an Excel). So nearly there 🙂

Expiscornovus
Dual Super User
Dual Super User

Hi @Gmma99,

 

You are correct, I was pointing to the wrong field. My bad.

 

In that case you could use this expression instead. That should be the person who is triggering the flow.

triggerBody()['entity']['teamsFlowRunContext']['From']['Name']
Gmma99
New Member

@Expiscornovus you've saved me hours! Thank you! This works a treat 🙂

Helpful resources

Announcements
MPA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

Learn to digitize and optimize business processes and connect all your applications to share data in real time.

New Process Advisor Capabilities carousel.png

Read the blog for the latest news

Read the latest about new experiences and capabilities in the Power Automate product blog.

PA Survey Carousel Image.png

We want to hear from you!

If you are a small business ISV/Reseller, share your thoughts with our research team.

Users online (3,021)