
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);
}Hi alqueen,
entity.getId (Client API reference)
Returns a string representing the GUID value for the record.
formContext.data.entity.getId();
entity.getId (Client API reference) - Power Apps | Microsoft Docs