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

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / get file content using...
Power Automate
Answered

get file content using path

(0) ShareShare
ReportReport
Posted on by 231

Hi EveryOne 🙂

I have a flow where i get "Get file content using path" where i get files from oneDrive using "Policy Nr"  it worked fine using the files below:

Khan321_0-1667753075804.pngKhan321_1-1667753096058.png

 

But now i have been told that files  are going to be saved with different names where the "Policy Nr" will be included. 

The files looks like this:

Khan321_2-1667753311091.png

 

My question is, is that possible to get the correct file using only "Policy Nr" even though it is only some part of the file name, not complete name?

and the dates in the file name changes all the time 🙂

 

Thanks for help in Advance 🙂

let me know if i you need more inof.

 

BR

Naji

Categories:
I have the same question (0)
  • Ellis Karim Profile Picture
    11,691 Super User 2025 Season 2 on at
    Hi @Khan321 ,
     
    If I understood correctly, you could use the contains() function to check whether the filename contains the Policy NR. For example:
    Snag_1a4a5777.png
     
     
    Ellis
    ____________________________________
    If I have answered your question, please mark the post as Solved.
    If you like my response, please give it a Thumbs Up.
  • Khan321 Profile Picture
    231 on at

    Hi @ekarim2020  🙂

     

    Yes you understood correct.

     I tried to do as you said but it gives an error.

     

    This is how i used in flow:  

    Is this correct way to do it?

     

    Khan321_2-1667810555158.png

     

    Khan321_3-1667810587064.png

     

     

    Khan321_0-1667810518805.png

     

     

    I get thing error. 

     

    Khan321_1-1667810531055.png

     

     

     

    BR

    Naji

  • Ellis Karim Profile Picture
    11,691 Super User 2025 Season 2 on at

    The 404 error means that the file could not be found.

     

    In your path I see:

    /Skrivebord/Power Automate/Excel filer/4874349

     

    You need to add the file extension to the Compose 2 action:

    /Skrivebord/Power Automate/Excel filer/4874349.xls

     


    Ellis
    ____________________________________
    If I have answered your question, please mark the post as Solved.
    If you like my response, please give it a Thumbs Up.

  • Khan321 Profile Picture
    231 on at

    @ekarim2020 thanks for help 🙂

     

    the flow runs but it makes the condition false.  it does not find the file after adding .xls.

     

     

    Khan321_1-1667815677227.png

     

    Khan321_2-1667815826403.png

     

     

  • Verified answer
    Ellis Karim Profile Picture
    11,691 Super User 2025 Season 2 on at

    Hi @Khan321 ,

     

    Please check the document path and file extension.

     

    Here is a working demo:

    Snag_1cdc8acc.png

    Snag_1cdd5261.png

    Snag_1cde05d3.png

     

    Snag_1cdf02ff.png


    Ellis
    ____________________________________
    If I have answered your question, please mark the post as Solved.
    If you like my response, please give it a Thumbs Up.

  • Khan321 Profile Picture
    231 on at

    @ekarim2020  🙂

     

    I think the path is correct.  Let me send you complete flow with path. 

     

    Khan321_1-1667818374295.png

     

     

     

     

     

     

    Her are the files located: 

    english:

    Khan321_4-1667818552280.png

    Danish

     

    Khan321_3-1667818484598.png

     

    error:

     

     

    Khan321_0-1667818342052.png

     

    Thanks for your help. 

     

  • Ellis Karim Profile Picture
    11,691 Super User 2025 Season 2 on at

    The document path should point to OneDrive in the cloud and not to your OneDrive files stored on your local computer:

    Snag_1d0188c4.png

     

    Note the forward slashes in the path above.

     


    Ellis
    ____________________________________
    If I have answered your question, please mark the post as Solved.
    If you like my response, please give it a Thumbs Up.

  • Khan321 Profile Picture
    231 on at

    @ekarim2020 

    same issue 🙂

    Khan321_0-1667820540403.png

    A stupid question:

    when we initial variable, we assign type "string" but the PoliceNr is "numbers"

    Khan321_1-1667820632005.png

    PoliceNr in excel file:

    Khan321_4-1667820794901.png

     

     

    and in condition we tells it if string has number.

     

    could it be an issue?

     

    Khan321_3-1667820706973.png

     

     

  • Ellis Karim Profile Picture
    11,691 Super User 2025 Season 2 on at

    Just to confirm, is 

    If the PolicyNR was being read as an integer value you would get an error, for example:

    Snag_1d4f6e4b.png

    If the Get file content using path is still not working, check and correct the path.

     

    Select the file manually in order to check the actual file path:

    Snag_1d59cfa5.png

    ekarim2020_0-1667824844846.png

     

     


    Ellis
    ____________________________________
    If I have answered your question, please mark the post as Solved.
    If you like my response, please give it a Thumbs Up.

  • Khan321 Profile Picture
    231 on at

    @ekarim2020  it works now but only for 1 file after choosing the direct path in the get file content.

     

    It only get the file content of the file which Policy Nr i gave in "Initialze variable".

    How can i make police Nr dynamics so takes all the file with the PoliceNr?

    Khan321_0-1667831241383.png

     

    Khan321_1-1667831258648.png

     

    Khan321_2-1667831309098.png

     

     

     

     

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 525 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 324 Moderator

#3
abm abm Profile Picture

abm abm 232 Most Valuable Professional

Last 30 days Overall leaderboard