Hi,
I have a submit button and the OnSelect looks like so;
Patch(
'SharePointList 1',
{
'Component Type': ComboBox_Type.Selected,
'Component Name': TextInput_Name.Text
}
);
Patch(
'SharePointList 2',
{
'Component Version':TextInput_Version.Text,
'Component Description': TextInput_Description.Text,
'Component Name':
{
Value: TextInput_Name.Text,
Id:
LookUp(
'SharePointList 1',
'Component Name' = TextInput_Name.Text
).ID
}
}, Form_Attachments.Updates
)
Here I am patching a new item to 'SharePointList 1' and then patching to 'SharePointList 2' using a Form in 'New' mode. In the second patch the 'Component Name' is searched for in 'SharePointList 1' and then used as the Component Name in 'SharePointList 2'. I had to do it this way as 'Component Name' is a lookup column that connects both lists.
My problem - After doing some research I realised that patching an Attachment to SP could be tricky. So, I followed the online advice and created a separate Form with just the Attachment property in it. I then referenced the Form in the Submit button above (Form_Attachments.Updates). but I keep getting an error saying that there is a Patch error and that the 'Component Name' is required. I guess this is because it doesn't know where to place the attachment as I am not referring to the specific item I would like to patch the attachment to.
I would appreciate if someone could help me with adding an attachment to a SPL when using a 'New' Form and when the target list has a required column that is of type Lookup to another list. Hope I've explained that ok.
Regards