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 / Unable to move folder ...
Power Automate
Unanswered

Unable to move folder in Document Library to another folder

(0) ShareShare
ReportReport
Posted on by 4

I am trying to have a scheduled recurring Power Automate task, to check a Document Library to see if a folder has been created there.

 

If it is, to move that Folder into another folder.

 

However, I am getting a BadRequest intially, then subsequent attempts, I get:

InvalidTemplate. Unable to process template language expressions for action 'Apply_to_each_2' at line '1' and column '13219': 'The template language expression 'body('List_folder')?['body']' cannot be evaluated because property 'body' cannot be selected. Array elements can only be selected using an integer index. Please see https://aka.ms/logicexpressions for usage details.'.

 

From what I can tell, the List Folder for the document library lists also the Forms and is causing the problem, so I don't know how I can get around it when the main focus is to move created folders and its contents.

 

Main purpose - Document Library is created to be an 'Upload Only' folder, to capture items being sent there, then moved to another folder.  Doing When file is created only works on files, but not on a folder with content items.

Categories:
I have the same question (0)
  • CFernandes Profile Picture
    8,482 Most Valuable Professional on at

    Hello @SKasai-UC,

     

    The Error Message -  Array elements can only be selected using an integer index. 

     

    With reference to error it seems that Apply to loop(array returned by List files in Folder) has only 1 or less items.

     

    If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!

  • SKasai-UC Profile Picture
    4 on at

    Well, from the results I was looking at and the Power Automate I was using as 'List folders'.  Now I have done this before with a normal folder in Sharepoint within a Document Library where it didn't error out, but this is at the root of a Document Library (The document library itself) and it did have 1 folder in the the document library I put in.

     

    The listing had 'Forms' and 'Test', but died immediately when it saw 'Forms'.

  • CFernandes Profile Picture
    8,482 Most Valuable Professional on at

    Hello @SKasai-UC ,

     

    The Forms should not Error out - I just gave it a Try -

     

    CFernandes_0-1618326649646.png

     

     

    If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!

  • SKasai-UC Profile Picture
    4 on at

    I would agree, as I did this process with a Folder within a Document Library, however, at the actual Document Library, the system kept giving me errors and it was tripping over the 'Forms' part.

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!

Leaderboard > Power Automate

#1
Haque Profile Picture

Haque 283

#2
David_MA Profile Picture

David_MA 256 Super User 2026 Season 1

#3
Expiscornovus Profile Picture

Expiscornovus 225 Most Valuable Professional

Last 30 days Overall leaderboard