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

Patch all items gallery in SharePoint List

Dear all,

I have a gallery that display items from SharePoint list. In the gallery, user need to enter marks in textbox input for each item. After done enter the marks for each items gallery, user need to click save and the marks will be updated in SharePoint list column.

 

Marks.PNG

 

What I did on the OnSelect button:

ForAll(Gallery1.AllItems,
    Patch('List Name', LookUp('List Name', Mark = 0),
    {
        Mark : Value(TextInput3.Text)
    })); 

 

However after submit, the marks are not patched correctly. The submitted marks are 5,4,3,2,1 (correct) but it updates in the list 5,4,3,1,2. Can refer image below of the column in SharePoint list.

SP List.PNG

 

How can I solve this issue? The issue is the marks submitted are not updated in the right item/row.

 

Thank you in advance!

1 ACCEPTED SOLUTION

Accepted Solutions

Hi @Anonymous :

I'v made a test but did not encountered the problem you mentinoned.

1\My SPlist-FlightList

2\Gallery1-Items

FlightList

3\TextInput3-Default

ThisItem.Mark

4\Add a button and set it's OnSelect property to

ForAll(
    RenameColumns(Gallery1.AllItems, "ID", "IDD"),
    Patch(FlightList, LookUp(FlightList, ID = IDD && Mark = 0),
    {
        Mark: Value(TextInput3.Text)
    }));

91.gif

Best Regards,

Bof

View solution in original post

6 REPLIES 6
v-bofeng-msft
Community Support
Community Support

Hi @Anonymous :

I think the ID can be used to locate the corresponding record waiting to be updated.

Please try this code:

 

ForAll(
    RenameColumns(Gallery1.AllItems,"ID","IDD"), /*Renamed to eliminate ambiguity*/
    Patch('List Name', LookUp('List Name', ID= IDD),
    {
        Mark : Value(TextInput3.Text)
    })); 

 

Best Regards,

Bof

Anonymous
Not applicable

Hi @v-bofeng-msft 

 

I have tried your suggestion but I added  &&  Mark = 0 on the lookup function, because for my case I have a few more "Mark" columns (Mark1, Mark2, Mark3) and only wanted to update that "Mark" column". I have tried below code, but it doesn't update anything in the column.

 

ForAll(
    RenameColumns(Gallery1.AllItems, "ID", "IDD"),
    Patch('List Name', LookUp('List Name', ID = IDD && Mark = 0),
    {
        Mark: Value(TextInput3.Text)
    }));

 

Hi @Anonymous :

I'v made a test but did not encountered the problem you mentinoned.

1\My SPlist-FlightList

2\Gallery1-Items

FlightList

3\TextInput3-Default

ThisItem.Mark

4\Add a button and set it's OnSelect property to

ForAll(
    RenameColumns(Gallery1.AllItems, "ID", "IDD"),
    Patch(FlightList, LookUp(FlightList, ID = IDD && Mark = 0),
    {
        Mark: Value(TextInput3.Text)
    }));

91.gif

Best Regards,

Bof

Anonymous
Not applicable

hi @v-bofeng-msft 

 

May I know what is type for your "Mark" column (single text or number)?

And the textbox input you used in the gallery is text or number?

Hi @Anonymous :

Make is a number column

textbox is a textbox control,I only set its default property.

Best Regards,

Bof

Anonymous
Not applicable

Hi @v-bofeng-msft 

 

Thank you for your help! Really appreciate that. I recreate the screen and follow your instruction. It's working correctly. Thank you so much!

Helpful resources

Announcements
Ignite 2022

WHAT’S NEXT AT MICROSOFT IGNITE 2022

Explore the latest innovations, learn from product experts and partners, level up your skillset, and create connections from around the world.

Power Apps Africa Challenge 2022

Power Apps Africa Challenge

Your chance to join an engaging competition of Power Platform enthusiasts.

Super User 2 - 2022 Congratulations

Welcome Super Users

The Super User program for 2022 - Season 2 has kicked off!

September Events 2022

Check out all of these events

Attend in person or online, there are incredible conferences and events happening all throughout the month of September.

Users online (4,171)