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

checkboxes state within the gallery after each row's record is updated

-----------------------------------------------

Background info for the problem start :

 

I have a collection that shows in the below screenshot.

 

image.png

Attribute: 'Oppo.ID' (not unique)

addressForEachO: stores the addresses for each 'Oppo.ID'

 

I have a drop down list in Powerapps which lists all the 'Oppo.ID'. Then I have a gallery that shows the addresses for each 'Oppo.ID' - the formula of the gallery is a lookup based on the 'Oppo.ID' to get the addressForEachO value (which contains the addresses for that particular 'Oppo.ID'

 

I need to do some operation with each addresses and mark them as done after the operation is eneded so I decided to use checkboxes in the gallery, please see the screenshot below:

 

image.png

 

I have an operation that allows the user to edit the addresses so there is a confirm button that patches the changes to the collection that stores the addresses and do the loop up again so that the changed addresses will be reflected in the gallery.

 

Background info for the problem end:

-----------------------------------------------

 

The issue is that whenever the user changes the record (do a lookup), the checkbox status will be changed back to default which is to untick. 

 

Is there anyway to store the checkbox states so that they won't get affected by the lookup (state can be maintained)

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Community Support
Community Support

Hi @IAmTheAppUser ,

Do you mean that after you click the check box, you may choose selection in drop down, you want the check box value retaining?

The reason why you met this problem is that when you choose different seletion in the drop down, the gallery will refresh automatically, so everytime the check box will display its default value.

Your action will always be refreshed, not retain.

I'm afraid there's no property about record action currently in PowerApps.

I've figure out an alternative way for your reference:

create two same collection, one is the real collection, one is used as a temporarly collection.

Use this temporarly collection to display items in gallery, update this collection every time you act action in checkboxes.

At last, the confirm button is used to update the real collection.

1)

ClearCollect(temporarlycollection,groupuserselecteddatabyoppold)
//save the real collection's data in temporarlycollection

2)

set the gallery's Items:

Filter(temporarlycollection,Dropdown1.Selected.Oppo.ID=Oppo.ID)

3)set the check box's OnCheck:

Patch(temporarlycollection,ThisItem,{fieldname:Checkbox1.Value})

set the check box's OnUncheck:

Patch(temporarlycollection,ThisItem,{fieldname:Checkbox1.Value})

4)

set the comfirm button's OnSelect:

ClearCollect(groupuserselecteddatabyoppold,temporarlycollection)
//use temporarlycollection data to update real collection

 

 

Best regards,

Community Support Team _ Phoebe Liu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

1 REPLY 1
Highlighted
Community Support
Community Support

Hi @IAmTheAppUser ,

Do you mean that after you click the check box, you may choose selection in drop down, you want the check box value retaining?

The reason why you met this problem is that when you choose different seletion in the drop down, the gallery will refresh automatically, so everytime the check box will display its default value.

Your action will always be refreshed, not retain.

I'm afraid there's no property about record action currently in PowerApps.

I've figure out an alternative way for your reference:

create two same collection, one is the real collection, one is used as a temporarly collection.

Use this temporarly collection to display items in gallery, update this collection every time you act action in checkboxes.

At last, the confirm button is used to update the real collection.

1)

ClearCollect(temporarlycollection,groupuserselecteddatabyoppold)
//save the real collection's data in temporarlycollection

2)

set the gallery's Items:

Filter(temporarlycollection,Dropdown1.Selected.Oppo.ID=Oppo.ID)

3)set the check box's OnCheck:

Patch(temporarlycollection,ThisItem,{fieldname:Checkbox1.Value})

set the check box's OnUncheck:

Patch(temporarlycollection,ThisItem,{fieldname:Checkbox1.Value})

4)

set the comfirm button's OnSelect:

ClearCollect(groupuserselecteddatabyoppold,temporarlycollection)
//use temporarlycollection data to update real collection

 

 

Best regards,

Community Support Team _ Phoebe Liu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

Helpful resources

Announcements
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

News & Announcements

Community Blog

Stay up tp date on the latest blogs and activities in the community News & Announcements.

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Top Solution Authors
Top Kudoed Authors
Users online (7,866)