web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Button to save variabl...
Power Apps
Unanswered

Button to save variables data and displaying them when another button is clicked

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

Hello,

 

I'm creating a simple simulation app where I have a slider named 'orderSlider'. When I choose a value from the orderSlider and click the button 'Order', 6 variables get updated in the rectangles (shown in the pic below).  

 

saumyadeep7591_0-1658454867288.png

 

I want functionality where if I click the 'Order' button, the following changes also get triggered:

1. all 6 variables generated are stored in a list or somewhere 

2. Week '1' (in red box) gets deactivated (grayed out) 

 

So, once again, if I change the slider and click the 'Order' button, the 6 variables get changed again and the above list gets appended and week 2 gets grayed out, and so on.

 

Now, when I click the 'Order History' button, all the data stored in the list for all the weeks (entered till now) shows up in a pop-up/ new screen.

 

 

Regards,

Sam

 

 

 

 

 

Categories:
  • BlessedCobba Profile Picture
    459 Super User 2024 Season 1 on at

    Hi Sam 

     

    if you want to store the data inside the app you can use the funtion eg. Collect(Collectionname, var1,var2,var3) and this will store them locally in the app. if you want to store them externally you can update the collectionname to an external data source. 
    if you want to be more specific about how it collects the data you might need to look at the patch function where you can define the data structure and which columns it uses

     

    Making the label disappear you could do a If statement in the visible property of that label. eg If(Countrows(collectionname)>=6, false, true)

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Thanks for the reply. I'm interested in storing the variables' data in an external source (say onedrive etc) so that I can plot graphs on the basis of that data later on. What approach should I follow for that?

    Note: All the variables mentioned in the screenshot are global variables.

     

    The 'OnSelect' trigger on the 'Order' button has the following lines of code:

    Set(_counter,_counter+1); 
    Set(_orderValue,OrderSlider.Value);
    Set(_incomingDelivery,RandBetween(7,OrderSlider.Value));
    Set(_cost,_cost+(_inventory*1.5));
    Set(_outgoingDelivery, If((_inventory+_incomingDelivery >= _customerOrders+_backOrder), _customerOrders+_backOrder, (_inventory+_incomingDelivery)));
    Set(_backOrder,_backOrder+_customerOrders-_outgoingDelivery);
    Set(_inventory,_inventory+_incomingDelivery-_outgoingDelivery);
    Set(_customerOrders,RandBetween(7,20));
    Set(_orderValue, 0);
    If(_backOrder>0, Set(_backorderWeeks,_backorderWeeks+1));
    If(_counter>5,Navigate(ExitScreen,Fade));

     

    Thanks in Advance 🙂

  • BlessedCobba Profile Picture
    459 Super User 2024 Season 1 on at

    Hi @Anonymous 

    Have a read through this doco that talks about the Patch function which can write / update external datasources 
    If you dont want to use premium connectors / licenses my suggestion would be to use a sharepoint list as the datasource
    https://docs.microsoft.com/en-us/power-platform/power-fx/reference/function-patch

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 395 Super User 2026 Season 2

#2
Mohsin Ali Profile Picture

Mohsin Ali 328

#3
WarrenBelz Profile Picture

WarrenBelz 260 Most Valuable Professional

Last 30 days Overall leaderboard