We have a SharePoint List that has pdf and excel attachments to items in the List. I am trying to create a flow that will allow users to get the attachments in the List sent to their email.
Current flow is like this:
1) For Selected item
2) Initialize variable (array)
3) Get attachments
4) For Each
a) Get attachment Content
b) Compose
c) Append to array variable
5) Send an email (V2)
The error keeps occurring on the Get attachment Content step -- 404 file not found.
ID is the List ID number (@triggerBody()?['entity']['ID']) and attachment ID is Id (file identifier) from Get attachments step
I've tried copying the link to the file from the parameters listed in the error dialog ("dataset" + "attachmentId") into my browser and the file doesn't open. SharePoint shows Page not found. So, I think there is an issue with the format there.
To that end, I tried adding decodeUriComponent() and replace functions around attachmentId, but that hasn't helped. Replace was to change %2b to %20.
I've also noticed that there is a blank space in the beginning of quoted attachementId, copied below.
Any help will be greatly appreciated.
{
"dataset": "https://corp.sharepoint.com/xxx",
"table": "xxxxx",
"itemId": 6748,
"attachmentId": " %252fLists%252fSample%2bList%252fAttachments%252f6748%252fGM%2bFile.pdf"
}