cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
JasonM72
Frequent Visitor

Using power automate with Lists in Teams and Channels PDFs work but Word Files Don't

I have built a flow which uses the 4 uploaded files from a group Form and adds them as attachments to the correct Row in the List in Teams.  I am only allowing Docs and PDFs. This fails for the Docs and passes for the PDFs.  If I save the 4 word files as PDFs in the same location and upload those instead it works fine.

 

The one thing I do notice though is that the Link changes for Word files compared to the pdfs.

 

Works
https://BLAHBLAH.sharepoint.com/sites/HRAutomation/Shared%20Documents/Apps/Microsoft%20Forms/2021%20...

 

Does not work in the flow
https://BLABLAH.sharepoint.com/sites/HRAutomation/_layouts/15/Doc.aspx?sourcedoc=%7BDA2E2885-2C69-44...

{
"status": 404,
"message": "File not found\r\nclientRequestId: ec90596a-06d3-4a27-b1bc-cdb3d8affed6\r\nserviceRequestId: ec90596a-06d3-4a27-b1bc-cdb3d8affed6"
}

 

 

Thoughts?

 

 

 

 

1 ACCEPTED SOLUTION

Accepted Solutions

Hello @JasonM72 ,

I just checked it on my environment, and if you want to access the files in Power Automate you should use their 'id', not their link, e.g. to upload the attached files into SP. It works for both, PDF and docx.

image.png



[ If I have answered your question, please Accept the post as a solution. ]
[ If you like my response, please give it a Thumbs Up. ]

[ I also blog about Power Automate solutions even for non-IT people. ]

View solution in original post

3 REPLIES 3
tom_riha
Super User
Super User

Hello @JasonM72 ,

I don't know how you build the document links, but the link for the .docx files is not a direct link to the document, it's a composed link that will open the document in an Online Office (Word) application.



[ If I have answered your question, please Accept the post as a solution. ]
[ If you like my response, please give it a Thumbs Up. ]

[ I also blog about Power Automate solutions even for non-IT people. ]

Tom,

The Links were autogenerated by Parsing the Microsoft Forms File Upload Question with the standard JSON for attachments.  

{
"type": "array",
"items": {
"type": "object",
"properties": {
"name": {
"type": "string"
},
"link": {
"type": "string"
},
"id": {
"type": "string"
},
"type": {},
"size": {
"type": "integer"
},
"referenceId": {
"type": "string"
},
"driveId": {
"type": "string"
},
"status": {
"type": "integer"
},
"uploadSessionUrl": {}
},
"required": [
"name",
"link",
"id",
"type",
"size",
"referenceId",
"driveId",
"status",
"uploadSessionUrl"
]
}
}
 
This generates standard links using the shared document folder system on SharePoint when the document uploaded type is pdf.
As soon as I upload a word file the shared document structure gets replaced with /_layouts/15/ ...... as shown above in the original post.   All I have done is select the word equivalent of the pdf named the same in the same original folder.
Partial Peek Code of the Parse Step:
{
    "inputs": {
        "content""@outputs('Get_response_details')?['body/rd05f520262104638abc7c8e96c00c8c4']",
        "schema": {
            "type""array",
            "items": {
                "type""object",
                "properties": {
                    "name": {
                        "type""string".....
Why the link: changes when the file type changes doesn't make sense.
Jason

Hello @JasonM72 ,

I just checked it on my environment, and if you want to access the files in Power Automate you should use their 'id', not their link, e.g. to upload the attached files into SP. It works for both, PDF and docx.

image.png



[ If I have answered your question, please Accept the post as a solution. ]
[ If you like my response, please give it a Thumbs Up. ]

[ I also blog about Power Automate solutions even for non-IT people. ]

Helpful resources

Announcements
Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

New Ideas Forum MPA.jpg

A new place to submit your Ideas for Power Automate

Announcing a new way to share your feedback with the Power Automate Team.

MPA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

Learn to digitize and optimize business processes and connect all your applications to share data in real time.

MPA Licensing.jpg

Ask your licensing questions at the Power Automate AMA!

Join Priya Kodukula and the licensing team, super users and MVPs to find answers to your questions on Power Automate licensing.

Users online (1,835)