
Announcements
I am doing a Powerapp where I am putting registrations for coming guided tours on a factory site.
One function in this is that I have a number of guides that should get a question thru the app, if they are available on a specific tour, or not. Looking something like this: (Sorry it’s in Swedish)
(Selecting the green button if you are available and the red if not)
The data is stored in a Sharepoint list, and at the moment the column is a person column. It would be good if it could be that, but if the function I want is not possible with a person column, I could change to something else.
My idea is to when the guide clicks the green button, a collection is created with the values already in the column Kan, and then the current user is added to the collection. This I have managed to function with the following code in Onselect:
ClearCollect(colKan,
{
'@odata.type': "#Microsoft.Azure.Connectors.SharePoint.SPListExpandedUser",
Claims: "1:0#.|membership|" & User().Email,
Department: "",
DisplayName: User().Email,
Email: User().Email,
JobTitle: "",
Picture: ""
}
);
ForAll(
DataCardValue2.SelectedItems,
Collect(
colKan,
{
'@odata.type': "#Microsoft.Azure.Connectors.SharePoint.SPListExpandedUser",
Claims: "1:0#.|membership|" & ThisRecord.Claims,
Department: "",
DisplayName: ThisRecord.DisplayName,
Email: ThisRecord.Email,
JobTitle: "",
Picture: ""
}
)
)
Then I want to patch this collection into the column Kan again, so the result would be the values that was there from the beginning with the current user added.
I have tried many different ways, but non is working.
At the moment I tried with the following code added after the code above:
Patch(Table(ForAll(colKan), DataCardValue2.Selected))
But in this case I get an error message “Invalid number of arguments: received 1, expected 2” regarding the Table function.
Is there a way around this or need I change my idea to use a person column?
The complete code under Onselect is at the moment:
ClearCollect(colKan,
{
'@odata.type': "#Microsoft.Azure.Connectors.SharePoint.SPListExpandedUser",
Claims: "1:0#.|membership|" & User().Email,
Department: "",
DisplayName: User().Email,
Email: User().Email,
JobTitle: "",
Picture: ""
}
);
ForAll(
DataCardValue2.SelectedItems,
Collect(
colKan,
{
'@odata.type': "#Microsoft.Azure.Connectors.SharePoint.SPListExpandedUser",
Claims: "1:0#.|membership|" & ThisRecord.Claims,
Department: "",
DisplayName: ThisRecord.DisplayName,
Email: ThisRecord.Email,
JobTitle: "",
Picture: ""
}
)
);
Patch(Table(ForAll(colKan), DataCardValue2.Selected))