Announcements
I have a simple counter stored in a variable: Set(varCounter;varCounter+1)
If i quit my application my variable is lost.
How can i store my variable and retrieve it at the launch of my app?
To do that you'll need to use some kind of data source like SharePoint or store it and load it using SaveData and LoadData. The one problem with SaveData/LoadData is that its not supported on all platforms. Its primarily meant for use on mobile devices.
First of all, happy new year and thank you for your reply. Can we store the counter number in a sharepoint list instead? or a permanent variable or a special formula? i only need to store one number and when i click on a button it increments "+1" to that number and store it again.
There is nothing like a permanent variable or a special formula. But yes, as I mentioned you can store the number in a data source like SharePoint. I mentioned LoadData and SaveData because they are easier to use for something like storing one number, if you can live with the limitations. Otherwise use SharePoint.
Hi @Sormick ,
Since it's a single number, I think you can leverage an environment variable to save the value. You can load/get the value OnStart of your App, it supports update using Patch function as well.
Please refer to below video:
Canvas Apps: Using Environment Variables - YouTube
and find related formula in below threads:
Solved: How to read Environment Variables in PowerApp? - Power Platform Community (microsoft.com)
Solved: How to update an Environment Variable value from c... - Power Platform Community (microsoft.com)
Best regards,
Yes, you can use an environment variable, but that will require a Premium license.
Many thanks all for your replies. I don't have a premium license. I think i will use instead a sharepoint list to store and retrieve the information needed.
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.
Congratulations to our community stars!
Expanding mentorship, skilling, and AI innovation
These are the community rock stars!
Stay up to date on forum activity by subscribing.
11manish 243 Super User 2026 Season 2
WarrenBelz 190 Most Valuable Professional
Mohsin Ali 135