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 / String variable as par...
Power Automate
Answered

String variable as parameter for 'list files in folder' throwing a BadRequest error

(0) ShareShare
ReportReport
Posted on by 4

Hi,

simple question: why is 'list files in folder' (OneDrive for Business) not accepting a variable in its parameter? Or what is it expecting actually?

As for the documentation it requires a string: https://docs.microsoft.com/en-gb/connectors/onedriveforbusiness/#list-files-in-folder

 

What I get though is a "BadRequest" error.

In case I add the path manually, everything works fine.

 

Screenshot 2021-06-13 at 23.20.16.png -> Screenshot 2021-06-13 at 23.21.00.png

 

Background: 

  • I want to move files from one OneDrive for Business folder to another.
  • I built a simple flow and made it work.
  • For different reasons I want to introduce a variable now, e.g. so that the notifications in a teams channel are more meaningful by mentioning the root path of the files mentioned above.

Having the variable at hand, I was hoping to also make use of it in the 'list files in folder' step, so that the flow is more flexible and scalable.

Categories:
I have the same question (0)
  • Verified answer
    v-bofeng-msft Profile Picture
    on at

    Hi @MarcusZ :

    The point is that:

    List files in folder required the folder id not the path

    You would need to first get the folder id in order to get the files

    please try:

    v-bofeng-msft_0-1623636038827.png

    I think this link will help you a lot:

    Best Regards,

    Bof

  • MarcusZ Profile Picture
    4 on at

    Ah, sure thing. And obviously the docu is also stating that, mentioning the the ID as the key.

    Misunderstood that. 

     

    Thanks so much, it worked now as I was hoping for!

  • schajuli Profile Picture
    2 on at

    Strange as it is, when I implement this the list files in folder step is working but then the copy operartion is throwing errors ... it's says it's missing the filename although I have:

    /TargetPath/Display Name

    when I remove this step and work without variables in List files in folders, then it works - why???

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 501 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 323 Moderator

#3
abm abm Profile Picture

abm abm 237 Most Valuable Professional

Last 30 days Overall leaderboard