Skip to main content

Notifications

Announcements

No record found.

Dynamics 365 general forum
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

Helpful resources

Quick Links

Replay now available! Dynamics 365 Community Call (CRM Edition)

Catch up on the first D365 Community Call held on 7/10

Community Spotlight of the Month

Kudos to Saurav Dhyani!

Congratulations to the June Top 10 community leaders!

These stars go above and beyond . . .

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 288,584 Super User

#2
Martin Dráb Profile Picture

Martin Dráb 225,864 Super User

#3
nmaenpaa Profile Picture

nmaenpaa 101,148

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans