cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Frequent Visitor

Automatically update label with API data in Component Factory

Hello everyone,

 

I'm currently in a team that's building front-end solution with Power Apps for the first time. Because of collaboration reasons we're using Component Factory, so we can work on different functionality at the same time.

 

So, right now I'm calling the REST service with the function: ClearCollect(HumidityData, getNewestHumidityData.Run()). This is nice and all because the needed API data is displayed in a label, but as of now it's implemented in a way that it works only when something is clicked. 

 

My question is - how do I call this function and update a label with the response data without clicking anywhere? And once this is achieved I want to keep updating this label real-time every time new data comes in from the API. Keep in mind that I'm doing this in Component Factory so there is no App module which functions can be called. 

 

Any suggestions?

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Memorable Member
Memorable Member

Re: Automatically update label with API data in Component Factory

Hi,

you can call the API on Screen Load.

Set(HumidityData, getNewestHumidityData.Run());


Click on Screen and Go to OnVisioble Properties and Place the above code 
 

VijayTailor_0-1600888265137.png

Or On On AppLoad you can also use the Same code and assign the Same to Label
For On APP Load Click on APP and OnSatart Property Place the above code.



and Assign "HumidityData" variable to label .

Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."


 

View solution in original post

1 REPLY 1
Highlighted
Memorable Member
Memorable Member

Re: Automatically update label with API data in Component Factory

Hi,

you can call the API on Screen Load.

Set(HumidityData, getNewestHumidityData.Run());


Click on Screen and Go to OnVisioble Properties and Place the above code 
 

VijayTailor_0-1600888265137.png

Or On On AppLoad you can also use the Same code and assign the Same to Label
For On APP Load Click on APP and OnSatart Property Place the above code.



and Assign "HumidityData" variable to label .

Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."


 

View solution in original post

Helpful resources

Announcements
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

Power Platform ISV Studio

Power Platform ISV Studio

ISV Studio is designed to become the go-to Power Platform destination for ISV’s to monitor & manage published applications.

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Tech Marathon

Maratón de Soluciones de Negocio Microsoft

Una semana de contenido con +100 sesiones educativas, consultorios, +10 workshops Premium, Hackaton, EXPO, Networking Hall y mucho más!

Top Solution Authors
Top Kudoed Authors
Users online (9,184)