cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
MidwayC11
Helper I
Helper I

Help with Checkbox in a gallery getting reset

I have a checkbox in a gallery. The data source bound to it data type is integers. When I checked the checkboxes = true in the gallery and open another screen from a button from the main screen then when I return to the main screen, the checkboxes in the gallery get resetted = false. But it happens one the first time. The second time I open the screen from the button and return to the main screen, the checkboxes don't get reset anymore.

This does not happen in my development envonment, it happens when I publish the App and open it from the Production environment.

 

Please some help or workaround to avoid the behavior.

 

2 ACCEPTED SOLUTIONS

Accepted Solutions

Have the checkbox oncheck action collect thisitem into a different collection and than patch those values.

Also you can set the uncheck action to removethisitem from collection.


Did I answer your question? Mark my post as a solution!

If you like my post please hit the Thumbs Up


Proud to be a Flownaut!


Check out my blog for Power Automate tips,
tricks, and guides
FlowAltDelete





View solution in original post

Hello @MidwayC11, here is what I had done when needing to bulk update.

 

Step 1)

In the first gallery (main gallery) I added a checkbox,

The checkbox I had made: OnCheck =

Collect(BulkUpdate, ThisItem)

BulkUpdate is a callection I will use to store the records I want to update.

BulkUpdate pic1.png

 

Step 2) 

I have OnUncheck =

Remove(BulkUpdate,ThisItem)

This will make only the checked items be added to UpdateBulk Collection. And the user can uncheck the box to remove the item from collection in real time.

BulkUpdate pic2.png

 

Step 3)

I have only added the second gallery to show what is going to be BulkUpdated.

BulkUpdate pic3.png

 

Step 4)

Add a button to do the BulkUpdate.

This can be done a few ways, for example with the Patch Command. For me I actually used a Flow to write the changes. I am more familiar with Flow and for me it was easier to write changes to the Data Source as I was using CDS and lots of lookup field.

 

Thanks, and have a great day.

 

--Josh

 


Did I answer your question? Mark my post as a solution!

If you like my post please hit the Thumbs Up


Proud to be a Flownaut!


Check out my blog for Power Automate tips,
tricks, and guides
FlowAltDelete





View solution in original post

5 REPLIES 5
leyburn19
Memorable Member
Memorable Member

If you have a checkbox in a gallery based on the data source,  selecting and unselecting will not change the datasource value.  you need to do a  patch or updateif  as the oncheck or uncheck action occurrs

 

Thanks for your reply. What I'm trying to do here is bulk update the gallery. So when the user checks a bunch of check boxes then they click a button to "submit" all the updates to the data source and that is just fine. The "thing"" is that the user checks some check boxes (before submitting the changes) then they decide to click an icon within the gallery that opens another screen to check details of the single item, that's when the "checked" checkboxes get unchecked when they return to the main screen.

 

I'm trying to find out why is this behaviour happening    

Have the checkbox oncheck action collect thisitem into a different collection and than patch those values.

Also you can set the uncheck action to removethisitem from collection.


Did I answer your question? Mark my post as a solution!

If you like my post please hit the Thumbs Up


Proud to be a Flownaut!


Check out my blog for Power Automate tips,
tricks, and guides
FlowAltDelete





Hi @Jcook ,

 

Can you please share more details about your app? Did you follow below steps to bulk update records in gallery?

 

Regards,

Mona

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

Hello @MidwayC11, here is what I had done when needing to bulk update.

 

Step 1)

In the first gallery (main gallery) I added a checkbox,

The checkbox I had made: OnCheck =

Collect(BulkUpdate, ThisItem)

BulkUpdate is a callection I will use to store the records I want to update.

BulkUpdate pic1.png

 

Step 2) 

I have OnUncheck =

Remove(BulkUpdate,ThisItem)

This will make only the checked items be added to UpdateBulk Collection. And the user can uncheck the box to remove the item from collection in real time.

BulkUpdate pic2.png

 

Step 3)

I have only added the second gallery to show what is going to be BulkUpdated.

BulkUpdate pic3.png

 

Step 4)

Add a button to do the BulkUpdate.

This can be done a few ways, for example with the Patch Command. For me I actually used a Flow to write the changes. I am more familiar with Flow and for me it was easier to write changes to the Data Source as I was using CDS and lots of lookup field.

 

Thanks, and have a great day.

 

--Josh

 


Did I answer your question? Mark my post as a solution!

If you like my post please hit the Thumbs Up


Proud to be a Flownaut!


Check out my blog for Power Automate tips,
tricks, and guides
FlowAltDelete





Helpful resources

Announcements
Power Apps News & Annoucements carousel

Power Apps News & Announcements

Keep up to date with current events and community announcements in the Power Apps community.

Community Call Conversations

Introducing the Community Calls Conversations

A great place where you can stay up to date with community calls and interact with the speakers.

Power Apps Community Blog Carousel

Power Apps Community Blog

Check out the latest Community Blog from the community!

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