cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Anonymous
Not applicable

Updating specific items in a gallery

I have a gallery that lists anywhere from 1 to 4 records and is filtered by another field as below:

 

SKU_number is tied to a Blend_ID (those are both outside the gallery) and the gallery is filtered by said Blend_ID.  I am able to patch all items successfully but yet I want to be able to go back into that "batch record" and see the values that were patched.  I was doing this with a lot of if statements and lookups for every field in the gallery.  But there has to be an easier way.  

 

Also I would like to be able to update a specific record.  Say the gallery has 4 items and I only need to update the Lot_Number field of one.  How can I do that?  I have tried adding a button to the gallery and patch that specific record but it wasn't working correctly.  It was updating the wrong record in the DB.  

 

My table has the following fields and the underlined ones are in the gallery:

ID(pk), Batch_Number, Green_Date, Green_ID(fk), Green_Lot_Number, Green_Weight, Green_Operator.

 

I have tried filtering my update patch by the ID and Batch_Number but it returns the wrong value (it always returns 1) as I was using First(Filter(....

 

Thanks for the help.

1 ACCEPTED SOLUTION

Accepted Solutions
Pstork1
Dual Super User III
Dual Super User III

If I'm envisioning the description correctly then I would suggest two things.

1) Yes, make the Blend a dropdown if possible to remove user error when entering

2) bind your gallery to a collection and when you grab the filtered datasource put it in the collection, then display that in the gallery. Let the user make all the changes they need to the items in the gallery (actually in the collection) then have a submit button to commit that batch of changes back to the datasource.  Until they commit the changes they can easily go back and make corrections.



-------------------------------------------------------------------------
If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

View solution in original post

4 REPLIES 4
Pstork1
Dual Super User III
Dual Super User III

The Key here is to recognize that a Gallery doesn't actually hold any records.  It displays a Sorted and Filtered view of records retrieved from a datasource or collection.  So if you want to change an existing record in a gallery what you need to do is change the underlying record in the datasource or collection and then refresh that datasource. The gallery will then show the new data.



-------------------------------------------------------------------------
If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.
Anonymous
Not applicable

Hello @Pstork1 ,

 

That is key!!  Thank you for explaining that a gallery is just a view.  I was spinning my wheels for hours last night.

 

Is there another way to display the recipe of the blend without the filtered gallery?  Other wise everytime the user enters the wrong info I will have to go in and change it.  Not a big deal though.  Or I wonder if it would be better to have that field be a filtered dropdown of available lot numbers, then the user selects the appropiate one.  Then no updating would need to be done unless they select the wrong Lot but I imagine the number of times that happens would be minimal to the typos of a text input field.

 

Thank you for the reply.

Pstork1
Dual Super User III
Dual Super User III

If I'm envisioning the description correctly then I would suggest two things.

1) Yes, make the Blend a dropdown if possible to remove user error when entering

2) bind your gallery to a collection and when you grab the filtered datasource put it in the collection, then display that in the gallery. Let the user make all the changes they need to the items in the gallery (actually in the collection) then have a submit button to commit that batch of changes back to the datasource.  Until they commit the changes they can easily go back and make corrections.



-------------------------------------------------------------------------
If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

View solution in original post

Anonymous
Not applicable

I think the easiest way is to have the filtered dropdown.  I feel that would eliminate 99% of the issue.  I know I won't have issues updating the other screens as they do not contain a gallery.

 

Thank you for the replies

Helpful resources

Announcements
PA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

Power Query PA Forum 768x460.png

Check it out!

Did you know that you can visit the Power Query Forum in Power BI and now Power Apps

V3_PVA CAmpaign Carousel.png

Community Challenge - Giveaways!

Participate in the Power Virtual Agents Community Challenge

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

Top Solution Authors
Top Kudoed Authors
Users online (3,055)