So I am working on Canvas app, where my end goal is to upload the generated pdf to SharePoint List Attachment Column (without using Power automate)
The PDF is generated by the app itself by : Set(myPDF, JSON(PDF('Test Screen',{ExpandContainers: true}),JSONFormat.IncludeBinaryData));
I don't see patch function supporting directly uploading pdf to SharePoint list, hence using Form Control for the SPO list - removed all the columns except the Attachments
made below changes to Attachments data card:
DisplayMode - DisplayMode.View
visible - false, I don't want user see the attachments at all
Items - [{Name:"test.pdf",Value:Substitute(myPDF,"""","")}]
And then Used the Patch function, on a button:
Patch(
SurveyForm,
LookUp(SurveyFormSurveyForm,ID=User.ID),
Form.Updates
);
and this is throwing error "Field Id is Required" (Not sure where)
Note: I just tested, where user has manually uploaded the attachment, patch function as expected - the attachment is visible in the Sharepoint List.
What changes i have to made, where generated pdf should auto upload to the attachments control. ?