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

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Service | Customer Service, Contact Center, Fie...
Suggested Answer

Sending POST request to Power Automate

(0) ShareShare
ReportReport
Posted on by 40

I'm sending a POST request to Power Automate from button in Dynamics. I'd like to send ID of user who triggered the flow and id of Quote in which the action was triggered. My current Java script is: 

function sendEmailWithTriggerred(executionContext) {
    var userSettings = Xrm.Utility.getGlobalContext().userSettings;
    var currentuserid = userSettings.userId;

    var formContext = executionContext;
    var recordID = formContext.getId;

    var req = new XMLHttpRequest();
    var url = 'xxx';

    req.open('POST', url);
    req.setRequestHeader("Content-Type", "application/json");
    var params = { "user": currentuserid, "quote": recordID}
    var data = JSON.stringify(params);

    req.send(data);
}

but only the first parameter is passed. What could I do?

I have the same question (0)
  • Suggested answer
    Community Member Profile Picture
    on at

    Hi alqueen,

    entity.getId (Client API reference)

    Returns a string representing the GUID value for the record.

    Syntax

    formContext.data.entity.getId();

    entity.getId (Client API reference) - Power Apps | Microsoft Docs 

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > Service | Customer Service, Contact Center, Field Service, Guides

#1
Tom_Gioielli Profile Picture

Tom_Gioielli 61 Super User 2025 Season 2

#2
Siv Sagar Profile Picture

Siv Sagar 52 Super User 2025 Season 2

#3
Daniyal Khaleel Profile Picture

Daniyal Khaleel 31 Most Valuable Professional

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans