Hi Community,
I've been trying to get a sensible solution for this. But after looking at so many posts and solutions I felt like I had to post one for my scenario.
I have an app, connected to a SharePoint list, which has a form with which I update the list with some basic values like Yes/No and other choices. This form has a Submit button. I want to capture the username of the user who submits this form by clicking the Submit button. The SharePoint list already has a 'Person or Group' type column to capture this information.
I've tried the below in the OnSelect property of the Submit button:
Patch(
DataSource,
Defaults(DataSource),
{
'Submitted by': {
Claims: "i:0#.f|membership|" & User().Email,
}
}
);
SubmitForm(Form)
where, 'Submitted by' is the "Person or Group" column name in the SharePoint list. I get the error: "The type of this argument 'Submittedby' does not match the expected type 'Table'. Found type 'Record'."
What else do I need to do? I basically want to capture the name of the logged in user who clicks on the Submit button to submit the form.
I even tried the simpler version of this where I added a 'single line of text' column and used
Patch(DataSource, Defaults(DataSource), {'Action Submitted by': User().FullName});
SubmitForm(Form)
where, 'Action Submitted by' is the 'single line of text' column.
Even this didn't work.
Patch(
'DataSource',
Defaults('MDataSource'),
{
'Action Submitted by': "Test"
}
);
SubmitForm(Form)
There are no errors, but the column remains blank.