cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
MarcusZ
New Member

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

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.

1 ACCEPTED SOLUTION

Accepted Solutions
v-bofeng-msft
Community Support
Community Support

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

View solution in original post

3 REPLIES 3
v-bofeng-msft
Community Support
Community Support

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

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!

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???

Helpful resources

Announcements
Microsoft 365 Conference – December 6-8, 2022

Microsoft 365 Conference – December 6-8, 2022

Join us in Las Vegas to experience community, incredible learning opportunities, and connections that will help grow skills, know-how, and more.

Users online (3,374)