Hi All,
I am quite new to power apps hence little chaos when building my very first power apps. Appreciate if i could get help via this community forum 😉.
In my power apps, i have a Gallery sourced data from SP List XYZ. I want to allow user to select item(s) from the Gallery <colGalleryList> (by ticking a Checkbox <'Checkbox3'> built inside the Gallery) and perform bulk updates on 2 fields (field 'ABC' with dropdown and field 'Text Comment' free Text) onto the SP List XYZ. I refer to the video clip from Reza Dorrani (https://www.youtube.com/watch?v=VzrarcM9W5k) when i built the 'Patch' function for the bulk updates, and it is working fine. Now, instead of user tick one by one the item(s) from the Gallery, i have added another Checkbox <'Checkbox 1'>outside of the Gallery for user to select/unselect all items from the Gallery. I managed to set this 'Checkbox1' to select/unselect items from the Gallery 'Checkbox3', but, with this mass-selected approach, my Patch function doesn't work. I suspect something needs to be set in the 'Checkbox1' and the Patch formula, i tried tweaking the formulas but failed... Below are the details from my canvas:-
'Checkbox1' outside of Gallery to select/unselect all items in the Gallery:-
OnCheck property: Set(varcheck, true)
OnUncheck property: Set(varcheck, false)
Default: blank
'Checkbox3' inside the Gallery for user to tick and select the item:
OnCheck property: Collect(colUpdates,ThisItem)
OnUncheck property: Remove(colUpdates,ThisItem)
Default: varcheck
Reset: varcheck
Patch button for the multi-lines bulk update:
UpdateIf(
colUpdates,
true,
{
'ABC': If(
IsBlank('ComboBox ABC'.Selected.Value),
'ABC',
'ComboBox ABC'.Selected
),
'Text Comment': If(
IsBlank('TextInput Text Comment'.Text),
'Text Comment',
Concatenate(
User().FullName & " " & Today() & ": ",
'TextInput Text Comment'.Text,
"; ",
Char(13),
'Text Comment'
)
)
}
);
Patch(
'SP List XYZ',
colUpdates);
Notify(
"Records Updates Success".
NotificationType.Success
);
Clear(
colUpdates);
Refresh('SP List XYZ');
ClearCollect(
colGalleryList,
'SP List XYZ'
);
Reset('ComboBox ABC');
Reset(TextInput Text Comment)
Initially without the Checkbox1 for select/unselect all, the Patch function is working fine and the bulk updates successfully reflected in the SP List XYZ, but now if i use the Checkbox1 to select all item, the Patch doesn't work, data not updated in Gallery nor SP List...
Appreciate someone could help me with the above-mentioned.🙏
Thanks, LS