Skip to main content
Community site session details

Community site session details

Session Id : Y/KQB3f8G36eHTs6/aZL+l
Power Automate - Building Flows
Unanswered

'Get file metadata' failed — Route did not match

Like (0) ShareShare
ReportReport
Posted on 7 Oct 2022 15:59:51 by 49

I'm trying to automatically create a SharePoint page when a SharePoint item is created. I found a YouTube tutorial on the process but I'm getting an unexpected error. The error occurs on the 'Get file metadata' step (first screenshot). I'm new to all of this so any help is greatly appreciated!

 

Here is the error:

 

 

Route did not match
clientRequestId: d9d3f6f0-d20c-4579-b848-097c05de492f
serviceRequestId: d9d3f6f0-d20c-4579-b848-097c05de492f

 

 

 

Here is my flow:

Collinjay_0-1665158234800.png

Collinjay_1-1665158258143.png

  • mr_rambles Profile Picture
    2 on 18 Oct 2022 at 21:17:02
    Re: 'Get file metadata' failed — Route did not match

    Hi @Expiscornovus,

    I stumbled on this thread as I'm having the same issue as @Collinjay. I expected the issue had to do with spaces in the filename, and so was excited to find your solution to encode a replacement of the '-' in place of the spaces, but I find that I have the same file not found error when I do this encoding. If I rename the file to eliminate the spaces, no error...

     

    I create a super simple flow just to duplicate the problem set to share here in the event you have additional thoughts on troubleshooting. Thanks in advance for any help you can provide!

    01 Simple Flow - Get File Metadata.png

    The expression value is:

    encodeUriComponent(concat('/SitePages/',replace(triggerBody()['text'], ' ', '-'),'.aspx'))

     

    When the filename has spaces "Beta Project 10_18_01.aspx", I get the error, and the raw inputs are with the - substituted for the spaces:

    {
     "host": {
     "connectionReferenceName": "shared_sharepointonline",
     "operationId": "GetFileMetadata"
     },
     "parameters": {
     "dataset": "https://company.sharepoint.com/sites/SharePointSiteName",
     "id": "%2FSitePages%2FBeta-Project-10_18_01.aspx"
     }
    }

     

    When the filename has been renamed to have no spaces "BetaProject10_18_01.aspx", I get no error, and the raw inputs are:

    {
     "host": {
     "connectionReferenceName": "shared_sharepointonline",
     "operationId": "GetFileMetadata"
     },
     "parameters": {
     "dataset": "https://company.sharepoint.com/sites/SharePointSiteName",
     "id": "%2FSitePages%2FBetaProject10_18_01.aspx"
     }
    }

     

     

  • Collinjay Profile Picture
    49 on 10 Oct 2022 at 16:00:24
    Re: 'Get file metadata' failed — Route did not match

    Hi @Expiscornovus ,

     

    Thanks for your continued help with this. I truly appreciate it.

     

    Page name example: 105__Monday test 01.aspx

    Page title example: Daily Dose Template

     

    I have a dynamic value in the page name to avoid duplicate page names. The dynamic value I've been using is the Form ID (my overall process for this is MS Forms submission > SharePoint item > SharePoint page). Each page name begins with the Form ID. In the example above, it's the "105." 

     

    The page title for these pages is always "Daily Dose Template." I don't want it to be that, but somewhere along the line, Power Automate uses the page template's title. I would like Power Automate to change the page title so it's the same as the page name (or close to it if there are any special characters).

  • Expiscornovus Profile Picture
    32,182 Most Valuable Professional on 08 Oct 2022 at 09:59:41
    Re: 'Get file metadata' failed — Route did not match

    Hi @Collinjay,

     

    A title of a page and a file name (and the file identifier) of a page can be different. Like mentioned earlier, this is because of special characters (Microsoft will change those characters in the filename).

     

    That's why it would help if you can show me the specific title value which you used in your testing. This way I can reproduce the issue and find a fix for you.

     

    Below is an example where I used the '#Testing &*%' as a Title value in my list item which triggers the flow. SharePoint ends up creating it with the -Testing-&--.aspx filename.

     

    Hopefully this clarifies things?

    title_different.png

     

     

  • Collinjay Profile Picture
    49 on 07 Oct 2022 at 23:09:06
    Re: 'Get file metadata' failed — Route did not match

    Hi @Expiscornovus ,

    The name of the list item is the same as the page I'm trying to create. Should they be different in some way?

     

    Below is a screenshot of the outputs. The code wouldn't all fit in the Power Automate window (without having to scroll) so I copied the code to an online editor and took a screenshot of it there. That's why the formatting is different.

     

    Picture8.png

  • Expiscornovus Profile Picture
    32,182 Most Valuable Professional on 07 Oct 2022 at 22:12:38
    Re: 'Get file metadata' failed — Route did not match

    Hi @Collinjay,

     

    What was the title of the list item which triggered the flow?

     

    listitemtest.PNG

     

    And can you also make a screenshot of the outputs section of the Send an HTTP request to SharePoint action in the flow run history. The action you are using to make a copy of a page?

  • Collinjay Profile Picture
    49 on 07 Oct 2022 at 21:14:52
    Re: 'Get file metadata' failed — Route did not match

    Hi @Expiscornovus ,

     

    After entering your expression the right way (facepalm), I get an error that says "File not found."

    Not sure if a screenshot is a helpful, but here's a screenshot of the error.

    Picture7.png

  • Expiscornovus Profile Picture
    32,182 Most Valuable Professional on 07 Oct 2022 at 20:54:18
    Re: 'Get file metadata' failed — Route did not match

    Hi @Collinjay,

     

    I see you have added it as plain text. Can you add the expression via the expression tab?

     

    ExpressionTab.gif

  • Collinjay Profile Picture
    49 on 07 Oct 2022 at 18:51:54
    Re: 'Get file metadata' failed — Route did not match

    Hi @Expiscornovus ,

     

    The Title value I'm using is from 'When an item is created.'

     

    Below is a screenshot of how I used your expression in my flow. Is that how I should do it?

     

    Picture6.jpg

  • Expiscornovus Profile Picture
    32,182 Most Valuable Professional on 07 Oct 2022 at 17:47:07
    Re: 'Get file metadata' failed — Route did not match

    Hi @Collinjay,

     

    Can you share a screenshot where you inserted the expression? Can you als share which Title value you used in your test?

  • Collinjay Profile Picture
    49 on 07 Oct 2022 at 17:31:57
    Re: 'Get file metadata' failed — Route did not match

    Hi @Expiscornovus ,

     

    Thank you for helping me out. Unfortunately the expression you provided did not work. Since I'm new to all of this, I wasn't sure if the parts right after body/Title were necessary, or just an example so I tried both

    encodeUriComponent(concat('/SitePages/',replace(triggerOutputs()?['body/Title'], ' ', '-'),'.aspx'))

    and

    encodeUriComponent(concat('/SitePages/',replace(triggerOutputs()?['body/Title']),'.aspx'))

    but I got the same error message as before.

     

     

    I also tried replacing 'Get file metadata' with 'Get file metadata using path'. That seemed to work but I got an error on my last step. The error message is "Bad gateway." Is that something you can help with here? Or should I create a new post?

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

Announcing our 2025 Season 2 Super Users!

A new season of Super Users has arrived, and we are so grateful for…

Paul Stork – Community Spotlight

We are honored to recognize Paul Stork as our July 2025 Community…

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 497 Super User 2025 Season 2

#2
David_MA Profile Picture

David_MA 436 Super User 2025 Season 2

#3
Riyaz_riz11 Profile Picture

Riyaz_riz11 244 Super User 2025 Season 2

Loading complete