I have a form that asks the user to upload a file, and I want the uploaded file to appear in an "Attachment" column on my SharePoint list. This was easy enough to do when the form was stored in my OneDrive, but moving the form to a Sharepoint site has made this significantly more difficult to figure out.
When the form was stored in my OneDrive, the flow looked like this: When a new response is submitted > Get response details > Search for users (V2) > Create item > Parse JSON > Get file content using path > Add attachment.
The seemingly obvious solution was to use the "Get file content using path" action that connects to SharePoint rather than the one that connects to OneDrive, but that doesn't work. In my "Add attachment" action, there is no dynamic content from the "Create item" action, which seems to be necessary for linking the attachment to the correct item. In addition, there is no appropriate dynamic content to fill the "File Content" field in the "Add attachment" action, which seems to be necessary for actually linking the file.
When the form was in my OneDrive, I used this YouTube tutorial to write the flow that I needed, but it no longer applies now that the form is stored on a Sharepoint site. A solution shared in the comments seems to be exactly what I need, but it's not explained in a way that's easy for the layman to understand and apply:
Actually, the "Get File" SharePoint action doesn't work to move those files attached to Group Forms because the "id" of the file that's provided in the JSON from the response details isn't the same as the "id" needed by the Get File action. You actually need to use the OneDrive actions to "Get file metadata" of the attachment, feeding it the "driveId" and "id" (concatenating them with a . in between) from the JSON, then user the Id output of that action with the OneDrive "Get file content" and THEN the SharePoint "Create file" action. It's a pain, but does work.
I can't figure this one out. It's counterintuitive to me that writing a flow to link my SharePoint list to a form stored on my SharePoint site is more difficult than linking my SharePoint list to a form that's stored in my OneDrive.