web
You’re offline. This is a read only version of the page.
close
Skip to main content
Community site session details

Community site session details

Session Id :
Power Automate - Building Flows
Answered

Json parses the relative Sharepoint-path for a pdf-upload different from an Office (Word)-document?

(1) ShareShare
ReportReport
Posted on by 2
I'm building a flow to collect answers and uploads from a Microsoft Forms and store them in Dataverse. After the storage in Dataverse is succesfully, I want to delete the file using a HTTP-request.
 
For now it's just a very simple test form with four questions, just to figure things out. I was very happy to get it to work the first attempt with uploading a pdf-file.
 
However, when I try to upload a Word-document, instead of the relativeURL Json parses the shareable link rather than the relative Url, which l can't use in the HTTP-request.
 
Using the same Parse Json scheme on the form output:
 
{
    "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 is the output for a PDF-file, which works for the HTTP-request:
"link""https://mytennant.sharepoint.com/sites/Group-Test/Shared%20Documents/Apps/Microsoft%20Forms/Untitled%20form/Question/UploadtestWord_%202.pdf"
 
And this is the output for a docx-file:
"link""https://mytennant.sharepoint.com/sites/Group-Test/_layouts/15/Doc.aspx?sourcedoc=%7B239B2D4E-9712-4562-A910-956D873176D9%7D&file=UploadtestWord_%206.docx&action=default&mobileredirect=true",
 
Can anyone help me retrieving the relative Url to an office365 file on Sharepoint?
I have the same question (0)
  • Verified answer
    Pstork1 Profile Picture
    67,902 Most Valuable Professional on at
    Json parses the relative Sharepoint-path for a pdf-upload different from an Office (Word)-document?
    If the file is uploaded in response to a question then the relative path, other than the file name, will always be the same.  It will be in your OneDrive for Business.  So I normally just store that path as a variable and then Concatenate it with the filename (name field) to get the relative path to the file. That bypasses the problem with Office files entirely.

    ----------------------------------------------------------------------------------
    If this Post helped you, please click "Does this answer your question" and give it a like to help others in the community find the answer too!

    Paul Papanek Stork, MVP
    Blog: https://www.dontpapanic.com/blog
     
  • Suggested answer
    BB-18031745-0 Profile Picture
    35 on at
    Json parses the relative Sharepoint-path for a pdf-upload different from an Office (Word)-document?
    If you extract the file's guid from the link or from somewhere else in the json, you can use that to access the file in your http request.

    With your example you would use https://mytennant.sharepoint.com/_api/web/GetFileById('239B2D4E-9712-4562-A910-956D873176D9')
  • Suggested answer
    abm abm Profile Picture
    32,561 Most Valuable Professional on at
    Json parses the relative Sharepoint-path for a pdf-upload different from an Office (Word)-document?
    Hi
     
    You can use a split() expression with delimiter as '/' then user the last() expression to get the last value. Then check for if that contains .pdf that means its a pdf one.
     
    If not PDF the try use the split() with '/' then use concat() expression and use the right index to get the split() results to get the domain name then get Group-Test form the split array and file name. Basically you trying to create the path of the word doc.
     
    Thanks
  • Suggested answer
    Pawel_Bernardzik Profile Picture
    15 on at
    Json parses the relative Sharepoint-path for a pdf-upload different from an Office (Word)-document?
    Hi, I think that the issue is that you are using Word Web link instead of the link to the actual Word document. Have you tried to use link in the format:

    "https://mytennant.sharepoint.com/sites/Group-Test/Shared%20Documents/WordDocument.docx"?

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

MS.Ragavendar – Community Spotlight

We are honored to recognize Ragavendar Swaminatha Subramanian as our September…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 760 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 429 Moderator

#3
Power Apps 1919 Profile Picture

Power Apps 1919 327

Last 30 days Overall leaderboard