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

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Get name of user who r...
Power Automate
Answered

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

(0) ShareShare
ReportReport
Posted on by 15

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 

Categories:
I have the same question (0)
  • Expiscornovus Profile Picture
    33,195 Most Valuable Professional on at

    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 Profile Picture
    15 on at

    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 🙂

  • Verified answer
    Expiscornovus Profile Picture
    33,195 Most Valuable Professional on at

    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 Profile Picture
    15 on at

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

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 501 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 323 Moderator

#3
abm abm Profile Picture

abm abm 237 Most Valuable Professional

Last 30 days Overall leaderboard