Hi @Anonymous,
The ForAll() function lets you loop actions. But for your use case you may have some easier options available like UpdateIf.
I would set the OnSelect actions of the X and checkmark to set a variable to what's selected in the gallery:
Set(selectedItem,ThisItem)
In the same button, have these actions:
If you click the check mark:
UpdateIf(dbo.datasource,1=1,
{
flag: If(Id=selectedItem.Id,"Active","Inactive")
}
)This means, "Update all records in the datasource (1=1 returns true for all records) so that if the Id of the record matches the selected record, make it active, else make it inactive."
If you hit delegation issues with UpdateIf--like you have more than 500 people, you can use ForAll() with Patch()-- let me know if that is the case and I can write up a sample. But there might be a few samples on this forum if you search for ForAll and Patch.
Brian