I have a Canva PowerApp which allows users to select a team from a dropdown, search for users then add them to a gallery. When the added to the gallery, it automatically adds to a SharePoint list as well to store this information. The issue I'm having is if multiple users are searched for, how do I add them the the gallery and SharePoint list. I have made two implementations, the first one can add multiple users to the gallery at once, but does nothing in SharePoint. The second one adds both to the gallery and SharePoint, but only adds one user (the most recent that was search for) even if the search feature allows multiple selections. Can someone please guide me to figure out where I went wrong please.
First Implementation:
ForAll(
FindUser.SelectedItems,
If(
IsBlank(
LookUp(
'Team Members List',
Team = SelectTeam.Selected.Value && User = Mail
)
),
Collect(
selectedUsers,
ThisRecord
),
Patch(
'Team Members List',
Defaults('Team Members List'),
{
Team: SelectTeam.Selected.Value,
User: Mail
}
)
)
)
Second Implementation:
If(
IsBlank(
LookUp(
'Team Members List',
Team = SelectTeam.Selected.Value && User = FindUser.Selected.Mail
)
),
Collect(
selectedUsers,
FindUser.Selected
);
Patch(
'Team Members List',
Defaults('Team Members List'),
{
Team: SelectTeam.Selected.Value,
User: FindUser.Selected.Mail
}
)
)