I am working on a customized form for a SharePoint list. I need to save files that are uploaded to the attachments field to a SharePoint library. I have followed these instructions https://www.matthewdevaney.com/power-apps-easiest-way-to-upload-files-to-a-sharepoint-document-library/ and added a flow to my app, but when I add the suggested code (below) to the OnSelect property of my submit button, I am getting errors. (I swapped out "SubmitContract" with "SPIFlist," which is the name of my form. Screenshots of what I entered and the errors I am getting are below.)
The instructions worked perfectly (thank you @mdevaney!) so I suspect that the issue has to do with a) the fact that I am working from a list rather than grabbing the attachments field and deleting it - do I even need to include a submit button? (If it's relevant: in my current form, the submit button is in the Attachments data card, which is set to required) and b) that I'm very new to Power Apps 😉
Any help in resolving my errors so my submit button triggers my flow would be very appreciated. I would also be open to doing things another way entirely if it makes more sense. Thanks in advance!
UploadFileToDocumentLibrary.Run( { contentBytes: First(att_SubmitContract_AttachFile.Attachments).Value, name: First(att_SubmitContract_AttachFile.Attachments).Name } );

