function onload(primaryControl){
var formContext = primaryControl;
// get current record guid.
var GUID = formContext.data.entity.getId();
GUID = GUID.slice(1,-1);
const req = new XMLHttpRequest();
// This URL comes from the connector in the flow / when an HTTP request is received / generated URL.
var url = "<your URL>";
req.open("POST",url,true);
req.setRequestHeader("Accept","application/json");
req.setRequestHeader("OData-MaxVersion","4.0");
req.setRequestHeader("OData-Version","4.0");
req.setRequestHeader("If-None-Match","null");
req.setRequestHeader("Content-Type","application/json ");
//Sends the GUID of the current record to the flow.
var body=`{"GUID":"${GUID}"}`;
req.send(body);
}