Skip to main content
Dynamics 365 general forum
Suggested answer

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

editSubscribe (0) ShareShare
ReportReport
Posted on by UG Leader

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 UG Leader 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 UG Leader 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 UG Leader 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

Helpful resources

Quick Links

What Motivates a Super User?

We know many of you visit the Dynamics 365 Community and Power Platform…

Demystifying Copilot with Georg Glantschnig…

Industry experts answer burning questions directly from our amazing Community…

Setting Up Knowledge Sources for Copilot…

Look at how configuring a comprehensive knowledge base is crucial…

Leaderboard

#1
Andre Arnaud de Calavon Profile Picture

Andre Arnaud de Cal... 283,066 Super User

#2
Martin Dráb Profile Picture

Martin Dráb 222,585 Super User

#3
nmaenpaa Profile Picture

nmaenpaa 101,138

Product updates

Dynamics 365 release plans