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

Fix the Variable value once submitted

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?

 

4 REPLIES 4
Highlighted
Responsive Resident
Responsive Resident

Re: Fix the Variable value once submitted

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.

Highlighted
Memorable Member
Memorable Member

Re: Fix the Variable value once submitted

Hi @gumgih ,

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

 

 

 









Highlighted
Frequent Visitor

Re: Fix the Variable value once submitted

@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.

Highlighted
Memorable Member
Memorable Member

Re: Fix the Variable value once submitted

Hi @gumgih ,

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

 

Helpful resources

Announcements
Community Conference

Power Platform Community Conference

Find your favorite faces from the community presenting at the Power Platform Community Conference!

Watch Now

Experience what’s next for Power Apps

See the latest Power Apps innovations, updates, and demos from the Microsoft Business Applications Launch Event.

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

Top Solution Authors
Top Kudoed Authors
Users online (5,399)