Skip to main content

Notifications

Microsoft Dynamics 365 | Integration, Dataverse...
Suggested answer

How do you call a FLOW/Power Automate with Ribbon Workbench and passing the user details to Flow

Posted on by Microsoft Employee

HI,

I plan to use FLOW to query the oldest unassigned case and assign that case to the current user. I am thinking of creating a custom button  (via Ribbon Workbench) and when clicked will activate the FLOW.

How can I use Ribbon Workbench to activate the Flow. Also how will the power automate know who is the current user is? 

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: How do you call a FLOW/Power Automate with Ribbon Workbench and passing the user details to Flow

    Hi,

    Have you tried to call the API like this:

    var userSettings = Xrm.Utility.getGlobalContext().userSettings;

    userSettings.userId;

    userSettings.userName;

    If this helped you, I'd appreciate it if you'd mark this as a Verified Answer, which may in turn help others as well.

    Best Regards,

    Frank Gong

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: How do you call a FLOW/Power Automate with Ribbon Workbench and passing the user details to Flow

    Thank you but how do I get the user details from Ribbon Workbench?

  • Suggested answer
    Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: How do you call a FLOW/Power Automate with Ribbon Workbench and passing the user details to Flow

    Hi,

    You need to add a button, and then add some JavaScript methods to the button:

    Add JavaScript to existing button (Ribbon WorkBench 2016) - Microsoft Dynamics CRM Forum Community Forum

    You need to use Http trigger in flow in order to accept user parameters:

    pastedimage1629255177579v1.png

    The user's parameters can be obtained using this api:

    getGlobalContext.userSettings (Client API reference) in model-driven apps - Power Apps | Microsoft Docs

    You only need to send http request to flow in JavaScript:

    XMLHttpRequest.response - Web APIs | MDN (mozilla.org)

    If this helped you, I'd appreciate it if you'd mark this as a Verified Answer, which may in turn help others as well.

    Best Regards,

    Frank Gong

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

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Community AMA December 12th

Join us as we continue to demystify the Dynamics 365 Contact Center

New! Quick response templatesâš¡

Save time with the new custom templates!

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,151 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 229,963 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Product updates

Dynamics 365 release plans