Hi guys,
I have a gallery which contains several info I pulled from a SP List. The data are showing just fine in the gallery but I'm having problems in saving the data back into SP. I don't have any forms in my PowerApp. Just a Gallery. And in the gallery, I have the following:
I used the following formula in my "submit" button
ForAll(
RenameColumns(
Filter(
collPeople,
IsModified
),
"ID",
"GallID"
),
Patch(
'SPList',
LookUp(
'SPList',
ID = GallID
),
{
'SPListField': radiobutton.Selected.Value,
Remarks: txtRemarks.Text
}
)
);
ClearCollect(
collPeople,
AddColumns(
'SPList',
"IsModified",
false
)
);
The formula submits my changes but it just won't get the correct values.
Solved! Go to Solution.
Hi @keihimekawa ,
The issue is from the Data source of ForAll function, it should be the Gallery.AllItems instead of the SharePint list, since the modification is reflected on control inside the gallery, not on the sharepoint list yet.
Please try this:
ForAll(
RenameColumns(
GalleryName.AllItems,
"ID",
"GallID"
),
Patch(
'SPList',
LookUp(
'SPList',
ID = GallID
),
{
'SPListField': radiobutton.Selected.Value,
Remarks: txtRemarks.Text
}
)
);
Sik
I tried changing the "Patch" area into something like this and it's still not working 😞 It only gets the first item and copies everything to the rest of the affected items.
Patch(
'SPList',
LookUp(
'SPList',
ID = GallID
),
{
'SPListField': Gallery1.Selected.radiobutton.Selected.Value,
Remarks: Gallery1.Selected.txtRemarks.Text
}
)
Hi @keihimekawa ,
The issue is from the Data source of ForAll function, it should be the Gallery.AllItems instead of the SharePint list, since the modification is reflected on control inside the gallery, not on the sharepoint list yet.
Please try this:
ForAll(
RenameColumns(
GalleryName.AllItems,
"ID",
"GallID"
),
Patch(
'SPList',
LookUp(
'SPList',
ID = GallID
),
{
'SPListField': radiobutton.Selected.Value,
Remarks: txtRemarks.Text
}
)
);
Sik
Thanks so much, @v-siky-msft! This definitely worked. I'm fairly new in PowerApps and am trying to figure things out. Your response did made a lot of sense.