Power Pages (Part2)- How to integrate & Run Cloud Flows with Power Pages

Опубликовано: 08 Сентябрь 2024
на канале: M365 Tech Help
171
9

This video is part of Power Pages Tutorial series.
Video explains how cloud flows can be integrated and called from Power Pages using Javascript on HTML pages.
Please watch full video to under step by step process.

Sample JS call
-------------------
document.getElementById("calltoactionbutton").addEventListener("click", function (event) {
event.preventDefault(); // Prevent form submission

var _url = "/_api/cloudflow/v1.0/trigger/e2c70f34-cd6c-ef11-a670-000d3a1134ed";

var data = {};

var payload = {};
payload.eventData = JSON.stringify(data);
shell
.ajaxSafePost({
type: "POST",
url: _url,
data: payload
})
.done(function (response) {
const result = JSON.parse(response);
console.log(result);
})
.fail(function () {
alert("failed");
});
});