Hi. I'm pulling my hair out. I've got a SP list custom form that's designed to create new records for employee changes. Two of these columns are Combobox controls that pull items from columns in another SP list. What I'm envisioning is the user filling out the form, clicking submit, the two Combobox values being put into a Collection, the form submits, then the Patch function will pull the last submitted form and patch the two columns in question with the values stored in the Collection before clearing it out and resetting the form.
Here's my OnSelect (forgive the lack of accessible names) :
Collect(Collection3, {'New Department': DataCardValue7.Selected, 'Status Change': DataCardValue6.Selected});
SubmitForm(SharePointForm1)
And this is my OnSuccess for the form (SharePointForm1):
Patch('Employee Changes',LookUp('Employee Changes', SharePointForm1.LastSubmit), {'New Department':Collection3.'New Department','Status Change':Collection3.'Status Change'})
;
Clear(Collection3)
;
Notify("Request successfully submitted!",NotificationType.Success);Navigate(MainPage,ScreenTransition.Fade)
I get this runtime error when trying to submit:
I know something is wrong with the Lookup, but I don't know the proper syntax to fix it. I'm also pretty positive I'm calling on the Collection3 items incorrectly but again, I've had very little luck finding google results on my specific scenario. Any help you can provide would be great. Thank you!
do you want to create a new record in 'Employee Changes' list?
Or you want to update an existing record there?
If update, how your master SP list relates to 'Employee Changes' list?
Thanks for the reply. Trying to create a new record, then patch two fields in that same record immediately afterwards. The master list is the 'Employee Changes' list.
'New Department' and 'Status Change' are text columns?
if yes:
Collect(Collection3, {'New Department': DataCardValue7.Selected.Value, 'Status Change': DataCardValue6.Selected.Value});
SubmitForm(SharePointForm1)
Patch('Employee Changes',LookUp('Employee Changes', ID = SharePointForm1.LastSubmit.ID), {'New Department':First(Collection3).'New Department','Status Change': First(Collection3).'Status Change'})
EDITED: you may need replace .Value with a name of info you want to be used.