cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Anonymous
Not applicable

Load web page untill data is sent to CDS

Hi All, I am triggering a flow on click of a button from a web page. Now, I want to load the web page or hide all the web-page content till all the data is sent to CDS via flow. How can I achieve that? Is there any variable returned by the flow after completion of data insertion which I can use in the portal for the above purpose?

7 REPLIES 7
ragavanrajan
Super User
Super User

Hi @Anonymous , 

 

You can add a variable in the flow and enable few settings to make this happen. 

 

here are the high level steps: 

 

1.  In the flow initialize your variable and capture the success and failure 

ragavanrajan_0-1605654495578.png

2. Click on the three little dots on the condition and click "configure run after" on success condition 

 

ragavanrajan_1-1605654598274.png

3. Select  the checkbox "is successful" 

 

ragavanrajan_2-1605654656291.png

4.  similary on the failed condition. Ensure to select " has failed or has timedout" like below 

 

ragavanrajan_3-1605654742715.png

5. Now this will allow you to capture the flow status and wait for the flow until it is complete. 

6. In the Portal you can add a container covered with white box and some nice status. Once the flow is complete using JS/ CSS hide the container and show the content. 

 

This is a high level but I hope you got the idea of how to achieve this by enabling the key settings in flow.  Hope this helps. 

 

------------

 

If you like this post, give a Thumbs up. Where it solved your request, Mark it as a Solution to enable other users find it.

Anonymous
Not applicable

Hi @ragavanrajan ,

Thank you for the reply,

I have one doubt in your suggested approach. How can read that particular variable on the portal?

I followed this blog to trigger a flow.

Hi @Anonymous,

 

As the flow you are building is triggering by Http request you can also use Http response action in your flow to send data back where you can handle it in javascript.

----------------------------------------------------
If you find this post helpful consider marking it as a solution to help others find it.
Anonymous
Not applicable

Hi @OOlashyn ,

Thank you for the reply

Can you please end me the link of post or blog which I can refer? 

Yes, you can check this blog post about using http trigger and sending http response in Power Automate. 

----------------------------------------------------
If you find this post helpful consider marking it as a solution to help others find it.
Anonymous
Not applicable

Hi @OOlashyn ,

I have followed the link but how can I read that response output in the portal?

OOlashyn
Super User
Super User

You can read it as regular response as part of the xmlhttprequest (that I assume you are using as it was used in the flow article that you shared in the beginning). Just google how to read response in xmlhttprequest for more example (like here or in official docs here or example code below).

//build http request string using URL from Power Automate flow
var req = new XMLHttpRequest();
var url = "https://<<copy HTTP POST URL from Power Automate here>>";
 
//register function to run on change of request stage  
req .onreadystatechange = function() {
    //if done
    if (req .readyState === 4) {
      //do something with response
      console.log(req .response);
    }
}

//send https request to Power Automate
req.open("POST", url, true);
req.setRequestHeader('Content-Type', 'application/json');
req.send(someDataForUpdate);
----------------------------------------------------
If you find this post helpful consider marking it as a solution to help others find it.

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

M365 768x460.jpg

Microsoft 365 Collaboration Conference | December 7–9, 2021

Join us, in-person, December 7–9 in Las Vegas, for the largest gathering of the Microsoft community in the world.

Users online (2,163)