I have a Java Script that is being executed at the click of a custom button on entity Main grid page. I am running a Power Automate flow with the trigger "When an HTTP Request is received". The flow is running fine on click of my custom button. I am attaching the code below. I want to show a dialog box with a message for the user whether the flow was triggered or failed to trigger. How do I get the response like Status code 200 or any other means to check if the flow was successfully called or if the HTTP Request was successfully made?

Below is the code
function ExportWithLogos(gridContext){
var grid = gridContext.getGrid();
//console.log(gridContext);
var fetchXMLStr = gridContext.getFetchXml();
console.log(fetchXMLStr);
var fetchXMLWithEscapedQuotes = fetchXMLStr.replace(/"/, '\\"');
console.log(fetchXMLWithEscapedQuotes);
var raw = JSON.stringify({"FetchXmlQuery": fetchXMLStr});
var myHeaders = new Headers();
myHeaders.append("Content-Type","application/json")
var requestOptions = {
method: 'POST',
headers: myHeaders,
body: raw
};
console.log(requestOptions);
Xrm.WebApi.retrieveMultipleRecords("environmentvariabledefinition", "?$select=defaultvalue&" + "$filter=schemaname eq 'tms_HTTPURLforExport'").then(
function success(results) {
console.log(results);
for (var i=0; i <results.entities.length;i++) {
var result = results.entities[i];
var flowURL = result["defaultvalue"];
console.log('This is flowURL ',flowURL);
fetch(flowURL, requestOptions)
.then(response => response.text())
.then(result => console.log(result))
.catch(error => console.log('error', error));
}
},
function (error)
{
console.log(error.message);
}
)
}
Thanks and Regards,
Ramesh Mukka