Hello, my friends!
It's "duplicate". PA Comunity didn't answer me.
Model Driven App, PowerAutomate Flow, only "Any user in my tenant" can trigger the flow.
This code works for "Anyone", but doesn't for "Any user in my tenant".
let reg = new XMLHttpRequest();
reg.open("POST", envVarRes.Value, true);
reg.setRequestHeader('Content-Type', 'application/json');
reg.send(JSON.stringify(data));So in this case I have to use App registrations. It's not a safe way, anybody can debug and catch the secret.
Is there a way to use the current user session? Maybe Xrm.WebApi.online.execute(Something)?
or maybe I need to use "Cookies"? But I haven't figured out how to use cookies for Power App.