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

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Extract the file name ...
Power Automate
Answered

Extract the file name and send it to PVA

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

Dear All, 

 

I would like to create a bot which sends the  URL to a file which the user is looking for. So i created a flow in PA, I am new to PA, I don't find some info in the forum about this use case. I would like to know if my flow goes in the right direction? Thank you for your help, 

Peggy2019_0-1672953761928.png

Peggy2019_1-1672954771065.png

 

Categories:
I have the same question (0)
  • v-chengfen-msft Profile Picture
    Microsoft Employee on at

    Hi @Anonymous ,

    Do you want the bot to fetch the URL of the file and send it to the user after the user enters the filename?

    Here is a test for your reference:

    Here is flow:

    vchengfenmsft_0-1672985673934.png

    vchengfenmsft_1-1672985698262.png

    Here is result:

    Here is file

    vchengfenmsft_3-1672985854811.png

     

    vchengfenmsft_2-1672985775518.png

     

    Best Regards

    Cheng Feng

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    hi Cheng Feng,

     

    Exactly and thank you for helping me! I m sure that it will help the community once again.

     

    So i tried to follow your instructions for the flow. Could you please tell me the syntax you entered in the filter query ? I am not able to reproduce it, since I am not a killer yet in dynamic content 😉 what does "substringof mean?

     

    please find below the whole flow

     

    Peggy2019_1-1672997378956.png

    Peggy2019_3-1672997725399.png

     

     

    Thank you in advance for your feedback

     

     

     

  • v-chengfen-msft Profile Picture
    Microsoft Employee on at

    HI @Anonymous ,

    This is a syntax of Filter query, not Expression

    vchengfenmsft_1-1672998299207.png

     

    substringof('',FileLeafRef)

    FileLeafRef refers to the file name

    vchengfenmsft_0-1672997998378.png

     

    Here is a link about filter query for your reference:

    Power Automate OData filter query with examples - SPGuides

     

    Best Regards

    Cheng Feng

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    hi Cheng Feng 

     

    thank you for your explanations. I have an error on my side:

    Peggy2019_0-1673025675192.png

     

    Peggy2019_1-1673025758373.png

     

    thank you for your advice.

  • v-chengfen-msft Profile Picture
    Microsoft Employee on at

    Hi @Anonymous ,

    Please lowercase the first letter of "Substringof"

    vchengfenmsft_0-1673226020028.png

    like this:

    vchengfenmsft_1-1673226127186.png

     

    Best Regards

    Cheng Feng

     

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

     

    Hi Cheng Feng,

    it seems better ! How do you get the URL of the file please? does the flow read inside the document? 

    thank you and best regards,

    Peggy

    Peggy2019_0-1673261073900.png

     

    normally it should come from the flow, but i got an error at the end

    Peggy2019_0-1673278000653.png

    I did the same as you?

    Peggy2019_1-1673278148531.png

     

  • v-chengfen-msft Profile Picture
    Microsoft Employee on at

    Hi @Anonymous ,

    From the screenshot you provided, the flow you created returns the file URL, but the Bot test returns the file name, please check whether the flow you selected is correct

    Here is my flow

    vchengfenmsft_2-1673313576953.png

    vchengfenmsft_3-1673313577122.png

    Here is my bot test

    vchengfenmsft_0-1673313495350.png

    vchengfenmsft_1-1673313531029.png

    Here is result :

    vchengfenmsft_4-1673313889824.png

     

     

    Best Regards

    Cheng Feng

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    hi Cheng Feng

     

    Thank you very much for your help. I managed to run the flow. The bot returned me the url of my test doc.

    Peggy2019_0-1673339247072.png

     

    I

    As I mentioned earlier, in my case the documents are in the Shared documents library and subfolders. So in the flow I limited the entry folders. But it does not work anymore if i do this.

     

    Peggy2019_1-1673339431212.png

     

    The bot does not return anymore the url?

    Peggy2019_2-1673339523725.png

     

    Peggy2019_3-1673339577627.png

     

    Thank you for the last help 🙂

    Best regards

     

  • v-chengfen-msft Profile Picture
    Microsoft Employee on at

    Hi @Anonymous ï¼Œ

    Please check your restricted entry folder for test files.

    Judging from your screenshot, [Get file] did not retrieve the file

    Here is a test:

    vchengfenmsft_0-1673341624642.png

     I limited the entry folders

    vchengfenmsft_1-1673341763982.png

    Here is bot test:

    Flow is succeeded

    vchengfenmsft_3-1673341871786.png

    Bot test is succeeded

     

    if the file is in this folder, it can get fileURL

    vchengfenmsft_2-1673341818597.png

    if the file is not in this folder, it cann't get fileURL

    vchengfenmsft_4-1673342162555.png

     

    Best Regards

    Cheng Feng

     

  • Verified answer
    Community Power Platform Member Profile Picture
    Microsoft Employee on at

    hi Cheng Feng

    it works perfectly well with the Test file in the following folder and with the setting include nested items set to NO. 

    Peggy2019_0-1673528046633.png

    Peggy2019_3-1673528611385.png

     

    the bot can even look for a subfolder name even if the requestor doesn't give the comprehensive file name, which is fine!!! because sometimes the user does not remember the exact file name.

     

    But since i have sub folders, I want the bot to look for files in the subfolders. So I changed the include nested items setting to YES in the flow. But then the bot is not able to find the test file and look for a file inside a subfolder - see the 3rd screenshot. what should i do to meet this objective? 

    Peggy2019_4-1673528774237.png

     

    Peggy2019_2-1673528411535.png

     

     

    Peggy2019_1-1673528207439.png

     

    Thank you very much,

    best regards

    peggy

     

     

     

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the March Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
Haque Profile Picture

Haque 608

#2
Valantis Profile Picture

Valantis 416

#3
11manish Profile Picture

11manish 348

Last 30 days Overall leaderboard