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 / Fix the Variable value...
Power Apps
Unanswered

Fix the Variable value once submitted

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

Hi,

 

I'm trying to build a functionality that can set the Variable to true once click on Approve button on UI, but after refreshing the application, variables get reset and the Approved icon got removed. I want to fix the icons once clicked on the "Approve" button. attaching a screenshot for the same.

 

Can anyone please help?

 

help.PNG
Categories:
I have the same question (0)
  • BrianS Profile Picture
    2,407 Super User 2024 Season 1 on at

    You want that check box to stay with the item - correct? It looks like you need to add a field to your database. A collection can be saved from a previous session on that device, but can't be shared from other users. The SaveData and LoadData functions will allow you to save collections on the device and re-use them.

  • Vijay Tailor Profile Picture
    2,961 on at

    Hi @Anonymous ,

    On Click on Button, you are setting the variable that is fine.

    I am not sure how to are doing and what is your business requirements,

    On gallery is not possible this variable to Update .

    So you can use below approach ,

    Step 1 : Select the Screen and Set the OnVisible Properties Like below.

     

     

     

    ClearCollect(GalColl,AddColumns(ApproverList,"IsApproved",false))

     

     

     

    VijayTailor_0-1602853927511.png

    Step 2: Now Set the Icon Visible Property Like below.

     

    VijayTailor_0-1602854135296.png

    Step 3 . Now to Add the Patch Code to Update The Collection.

     

    Patch(GalColl,ThisItem,{IsApproved:true});

     

    VijayTailor_1-1602854195172.png


    Note - Use this Collection as Data source in Gallery Like Below - 

    VijayTailor_3-1602854274331.png

     

     

    Thanks,
    Vijay

    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."-Vijay

     

     

     









  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    @VijayTailor 

     

    Thank for your response, but here I'm not using these symbols from gallery items, I have put explicit symbols in front of each row and enabling the visible property for them by clicking on the Approve button, is there any way to save the variable values permanently once approved so even after refresh it will show the Check Symbol.

  • Vijay Tailor Profile Picture
    2,961 on at

    Hi @Anonymous ,

    Yes, Possible,

    you can use the Patch Code directly to update the approved status of the source.

    if you are using a gallery then no need to explicitly add an icon or button for all the gallery have the capability once you drag in the first row then automatically the same button is populated for all the row, the same thing I mentioned in my previous reply.
    You can use code like below to update value directly into source - 

    Patch(SourceName,ThisItem,{IsApproved:true}); //This you can use in gallry button.

    Thanks,

    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."-Vijay

     

  • timl Profile Picture
    36,682 Super User 2026 Season 1 on at

    Hi @Anonymous 

    >> is there any way to save the variable values permanently once approved so even after refresh it will show the Check Symbol.

    As the others have said, the lifetime of a variable exists only for the duration of a session.

    If you want to persist your variable values between sessions, you would have to save thoses values to your underlying data store as @VijayTailor  suggests, or to persist those values with the SaveData and LoadData function as @BrianS  suggests

    The benefit of the SaveData technique is that it will save the variables on the per user/device basis, if that is what you require.

     

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Leaderboard > Power Apps

#1
Haque Profile Picture

Haque 94

#2
WarrenBelz Profile Picture

WarrenBelz 82 Most Valuable Professional

#3
Kalathiya Profile Picture

Kalathiya 38 Super User 2026 Season 1

Last 30 days Overall leaderboard