Hi I've been building a flow which takes a response from a form with an attachment and creates a Sharepoint list item with the attachment attached. However I'm having an issue where the attached files will not open (for pdf) or are unreadable (png).
Here is the flow
So Initially I was having issues with the get file content step as I've seen in guides that you normally use the get file content from OneDrive. However as we are using a group form the data from the form is being saved in a SharePoint site so I found that I needed to change the step to get the data from that SharePoint site. The issue I'm having is that the SharePoint list where the form data is saved is different to the list where the actual flow occurs. When I point to the place where the attachments are saved the flow does not attach the file to the list item. But when I point towards the SharePoint list with the list item it does get attached, however the file is not readable.
For Context the main SharePoint list is called Cash Sheet which is where the form response gets filled in through the flow
The place where the Form attachment gets saved is called Automation Forms
Here is an example of me attempting to open an image
Also when checking the automation folder with the form attachment data, I'm able to view the files absolutely fine, its just after the attachment step something goes wrong
Perhaps there is an issue with the format of those files being attached or maybe its an issue within SharePoint in regards to where the files are saved, I'm not quite sure. Any help would be appreciated.
You're welcome 🙂
Under Add attachment to list item, File content is mapped to body of ms froms, please remove that make sure it is mapped to file content coming from Get file content using path
Let me know if this works.
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Could you please share the screenshot of your flow?
Perfect, the Parse JSON step now is working.
However I'm still getting the issue of the attachment being unreadable when attached to the line item
Sorry i think typed it wrong, my bad. please use the below steps to generate the prase JSON schema.
1. Go to one of your flow runs.
2. Expand Get response details.
3. In the upload file question, please copy the schema.
4. Click on Generate from sample, then paste the schema copied from get response details and click on done.
5. this should create a Schema for you.
Let me know if this works.
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Thank you for answering @Cr1t
So I've set everything up the way you explained but I'm getting an error with the Parse JSON step
Just to check I've copied the correct code from get response detail, its this here?
Hellp please try these steps. After creating item in sharepoint use a prase JSON.
For content: Map your attachment field from MS forms.
Schema: To get the schema, click on ‘Generate from sample’ and then provide the ‘get response details’ json code from the output.
After Json use Apply to each
In file path, please map the name from JSON.
Let me know if this works.
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
WarrenBelz
146,765
Most Valuable Professional
RandyHayes
76,287
Super User 2024 Season 1
Pstork1
66,091
Most Valuable Professional