Hi @Alkahfi,
I guess the flow is called as you insert something in your table. Unfortunately, that's a way that won't work as you have no direct listening to a flow answer from power pages. Meaning you fire the approve event and something is changed in dataverse but you are not asynchronously waiting for a response.
I would say the best way for that is to go with Cloud Flows WebAPI (Ms Learn ). Use that one and the code snippet:
shell.ajaxSafePost({
type: "POST",
contentType: "application/json",
url: "_api/cloudflow/v1.0/trigger/44a4b2f2-0d1a-4820-bf93-9376278d49c4",
data: JSON.stringify({"eventData":JSON.stringify({"Email": "abc@contoso.com" })}),
processData: false,
global: false
})
.done(function (response) {
})
.fail(function(){
});
Hide the page and indicate somehow that it's loading. When receiving the response use windows.location.href to redirect the user to the page you want. In case you than need to fill in data from the entry you just updated. Get the Id and use that ID to fetch the data for the next form etc.
--------------------------------------------------------------------------------------
Hope that helps.
If the post solves your problem, please mark it as solution. If it helps, consider a thumbs up.