cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
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
Highlighted
Dual Super User II
Dual Super User II

Re: Updating specific items in a gallery

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
Highlighted
Dual Super User II
Dual Super User II

Re: Updating specific items in a gallery

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.
Highlighted
Anonymous
Not applicable

Re: Updating specific items in a gallery

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.

Highlighted
Dual Super User II
Dual Super User II

Re: Updating specific items in a gallery

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

Highlighted
Anonymous
Not applicable

Re: Updating specific items in a gallery

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
August 2020 Community Challenge: Can You Solve These?

August 2020 Community Challenge: Can You Solve These?

We're excited to announce our first cross-community 'Can You Solve These?' challenge!

secondImage

Return to Workplace

Reopen responsibly, monitor intelligently, and protect continuously with solutions for a safer work environment.

secondImage

Super Users Coming in August

We are excited for the next Super User season.

secondImage

Community User Group Member Badges

FIll out a quick form to claim your community user group member badge today!

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Top Solution Authors
Top Kudoed Authors
Users online (6,602)