I have a SharePoint list that includes a field of type "Person or Group" linked to Office 365. Works great in SharePoint and mostly works on my PowerApp Mobile app.
I have about 10 fields - mostly text, a few listboxes and and file attachment object. Like many others, I've struggled with the various forms of data persistence. Since I broke up my app into 3 edit forms I understand that I must use a the Patch() function to save new records.
I successfully added the code (below) to the "Next" button at the bottom of the screen that includes the input that supports the "Person or Group" field. So, whenever I pick a name and I'm in Edit mode it successfully saves the my choice to my SharePoint list 100% of the time. However, I still need to use the Patch for my final screen that must add a new record with all data from all 3 forms. Can anyone help with the PowerApps Patch syntax for including the "Person or Group" object.
// ------------------------------------------------------------------------------------------
// If app is editing an existing record - use the SubmitForm to Save this form's data.
If(
EditForm1.Mode = FormMode.Edit,
SubmitForm(EditForm1);EditForm(EditForm2),
NewForm(EditForm2)
);
Navigate(
EditScreen2,
ScreenTransition.Fade
)
If I add something like the following into my Patch command for Adds
{Managers: lstManagers.Selected},
The code window shows me the following error when I hover over the angry line of code:
"The type of this argument 'Managers' does not match the expected type 'Table' . Found type 'Record'.
Once I understand the syntax for using Patch with "Person or Group", I will elimnate the sloppy approach I took to inserting the SubmitForm in a Next button in the middle of the app. However, it worked and made me slightly happy.