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 / Post Message to Teams ...
Power Automate
Unanswered

Post Message to Teams as User, not as Flow Owner

(0) ShareShare
ReportReport
Posted on by 17

This is probably easy, but I can't figure it out - how do I compose a "Post Message" step to post a message in teams as the person who triggered the Flow, not as me (the Flow owner)?

Flow is triggered by a checkbox in Dynamics:

  1. When box is checked "Yes" and record is saved...
  2. Flow is triggered ("When row is ...modified") -- Scope is Business Unit, so anyone can trigger it
  3. Flow then does some things like getting an @mention token and some other info from the Dynamics record that will go into the Teams post
  4. Flow also identifies the Team / Channel to post to

    All of this works fine.
  5. Flow then posts a message to Teams.  But no matter what User executed the trigger in Dynamics, the post shows up as coming from me.

It's a great Flow, the only issue is that I want the Post in Teams to come from the person triggering the Flow in Dynamics, not from me. 

Here is the step to "Post Message" - I have a feeling there is a way I can identify the executing user in Dynamics (probably via "Modified by") and then write a custom expression to replace "User" in the "Post As" field...but I can't figure it out.

GDBarkin_0-1665705576185.png

 

Categories:
I have the same question (0)
  • SudeepGhatakNZ Profile Picture
    14,394 Most Valuable Professional on at

    What is the trigger for your flow?

    I was under the impression that "Post as" = "User" will get the user info from the context.

    So if an item is created by ABC, the message will be posted as ABC.

    Is that not the case?

     

     

  • grantjenkins Profile Picture
    11,063 Moderator on at

    I would be checking who is listed as Created by in the row that triggered the flow. So when a user clicks on Yes, what account is actually saving the record?

  • SudeepGhatakNZ Profile Picture
    14,394 Most Valuable Professional on at

    Did you get someone to test this for you? I belive it will post a message in Teams as that account

     

     

  • GBarkin Profile Picture
    17 on at

    Of course I had someone else test it!  The post in Teams still came from me. 

    Here is the trigger:

    GDBarkin_0-1665783505196.png

    "WIP" is a custom Dynamics entity.

    The trigger Column is a boolean checkbox on the entity form.

    I have also confirmed that the user who MODIFIES a record is recorded as the User in CRM, regardless of who CREATED the record.  Also, as a cross-check, I checked the boolean trigger box on a record I did NOT create, and the Teams message came from me, not the user who created that record in Dynamics.  We've tested this backwards and forwards, and in every instance, the Teams message gets posted by me (the flow developer / owner) regardless of who modifies or creates the Dynamics record.  

    And finally - I even tried changing the Flow trigger "Run As" to "Modifying user."  No change.

    As I said in my initial post, I suspect there may be a way to write a custom expression to replace "User" in the "Post As" field, it seems to me that if that field allows a custom expression, there must be some purpose and solution. 

     

  • grantjenkins Profile Picture
    11,063 Moderator on at

     

    This comes directly from the Power Platform documentation. Since it's an automated trigger it will run under your context if you're the owner of the flow.

     

    • Automated and scheduled flows always run in the context of the flow owner regardless of who starts the flow or what accounts are used for connections inside of the flow. Instant flows (button, hybrid triggers) run in the context of the user who invokes them, regardless of the connections the flow uses.

     

    This doesn't answer your question regarding the how, but at least it confirms that the flow will always run under your context in this instance. I'm not entirely sure it's possible to post as someone else.

  • GBarkin Profile Picture
    17 on at

    Yes, that's my impression as well, though I suspect somewhere out there SOMEONE knows how to override this with expression syntax. 

  • rommelngo Profile Picture
    4 on at

    I wish to know also if there is a way that the message is posted as the user not the flow owner, this is also happening to me.

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