Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics 365 | Integration, Dataverse...
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 Power Automate "When a HTTP request is received" gets only first parameter. What should do to pass both parameters?

EDIT: It seems that I'm not getting ID of current Quote. How could I repair it?

  • Suggested answer
    Guido Preite Profile Picture
    Guido Preite 54,087 Super User 2024 Season 1 on at
    RE: Sending POST request to Power Automate

    to get the record Id you should do

    var formContext = executionContext.getFormContext();
    var recordID = formContext.data.entity.getId();

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!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Verified Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

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

#2
Martin Dráb Profile Picture

Martin Dráb 230,503 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Product updates

Dynamics 365 release plans