Skip to main content

Notifications

Create Power Automate cloud flows
Answered

How to Use Indexes to Select Files in Power Automate from a SharePoint Folder?

Posted on by 14

Hi ! I used the "List folder" action in Power Automate to retrieve all images from a SharePoint folder. Now, I want to fetch each image individually using the "Get File Content" action for further processing.

To do this, I'd like to know how to use indexes to dynamically select a specific file from the list based on its position (index). How can I use indexes in my flow to achieve this? Any guidance would be appreciated!

Categories:
  • Verified answer
    JC-29080851-0 Profile Picture
    JC-29080851-0 14 on at
    How to Use Indexes to Select Files in Power Automate from a SharePoint Folder?
    I found a solution using a combination of the "first" and "skip" functions.
     
    To get the first element of the list:
    first(body('action_name'))?['Id']
     
    To get the nth element of the list:
    first(skip(body('action_name'), n-1))?['Id']
     

Helpful resources

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 140,745

#2
RandyHayes Profile Picture

RandyHayes 76,308

#3
Pstork1 Profile Picture

Pstork1 63,355

Leaderboard

Featured topics