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

Community site session details

Session Id :
Power Automate - Building Flows
Answered

"List Folder" order of items in Array

(0) ShareShare
ReportReport
Posted on by 18

Hi there, 

 

I am using a flow to fill out a Word template with multiple images and descriptions for these. I am doing this by using one flow to store these images in a folder with the corresponding descriptions input in different columns. I then have another flow to take these images and then fill in the Word document. This goes through the folder using "List Folder" and then stores the photos and descriptions into separate arrays. I then fill out the Word content control values with the corresponding array items.

 

However, the order of the items depends on the order of the items when retrieved be "List Folder." I have found that these aren't alphabetical or sorted by when the item was created, so the order of the items in the Word document seem random to me. Is there any way to sort out how "List Folder" returns the items?

 

Thanks!

I have the same question (0)
  • Verified answer
    efialttes Profile Picture
    14,756 on at
    Re: "List Folder" order of items in Array

    Sharepoint, right?

    According to the official doc, 'List folder' does not provide an input to request a specific order.

    So I guess you should try with 'Get files -properties only-' so you can add the appropriate ODATA expression to 'Order By' input

    Sharepoint Order By syntax described here

    https://powerusers.microsoft.com/t5/Building-Flows/Sytnax-for-Odata-Order-By/td-p/55185

     

    I believe your library has more than one Folder, this means you probably need to add the appropriate ODATA expression -probably based on substringof()- in 'Filter Query' input to get the ones inside your target Folder

    GReat links for Sharepoint Filter Query Syntax here

    https://sharepains.com/2018/11/12/sharepoint-get-items-odata-filter-query/

    https://blog.velingeorgiev.com/powerautomate-and-sharepoint-odata-filter-queries

     

    If OData Filter approach does not work, you can try with Filter Array instead

    https://powerusers.microsoft.com/t5/Building-Flows/ODATA-Filter-on-a-Sharepoint-Get-Items-folder-field/td-p/175860

     

    So in this screenshot you will see an example on how to order files by 'Created' date time in descending order, then I filter those store in subfolder named 'Praveen'

    Flow_ODATAOrder_FilterPath.png

    Please note my dynamic content menu options are displayed in Spanish, 'Ruta de acceso...' equals 'Folder Path' -{Path}-

    Hope this makes sense

     

  • val_tibay Profile Picture
    18 on at
    Re: "List Folder" order of items in Array

    Thanks @efialttes , that's exactly what I was looking for!

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Chiara Carbone – Community Spotlight

We are honored to recognize Chiara Carbone as our Community Spotlight for November…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 691 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 431 Moderator

#3
developerAJ Profile Picture

developerAJ 266

Last 30 days Overall leaderboard