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.
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.
How can I solve this issue? The issue is the marks submitted are not updated in the right item/row.
Thank you in advance!
Solved! Go to Solution.
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)
}));
Best Regards,
Bof
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
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)
}));
Best Regards,
Bof
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
Thank you for your help! Really appreciate that. I recreate the screen and follow your instruction. It's working correctly. Thank you so much!
User | Count |
---|---|
252 | |
107 | |
88 | |
51 | |
44 |