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 / Get Files within a Fol...
Power Automate
Unanswered

Get Files within a Folder on SharePoint

(0) ShareShare
ReportReport
Posted on by

Hi,

 

I have a flow that works well and this is what it does:

 

- Looks at the files within a folder on SharePoint and will send a monthly email reminder on the day it was upload i.e. if uploaded on 2nd January, on 2nd February/March/April, etc., you will get an email reminder about that specific file in that folder.

 

The issue arose that within that folder, there are sub-folders with files and the flow is not picking up the files within the sub-folders. 
I have tried adding a filter array but I am not too sure how and the flow is still failing. 

 

If anyone can assist, that would be greatly appreciated.

 

Thanks. 

 

1.JPG

Categories:
I have the same question (0)
  • Expiscornovus Profile Picture
    33,189 Most Valuable Professional on at

    Hi @drishm,

     

    Just to double check. What is the value of your Include Nested Items option in your Get files (properties only) action. Is that field set to Yes in your configuration?

     

    includenesteditems.png

  • drishm Profile Picture
    on at

    Hi @Expiscornovus , yes it is set to include nested items

    drishm_0-1643809904159.png

     

  • drishm Profile Picture
    on at

    Hi @Expiscornovus ,

     

    Not sure if this might help...I went to one of the failed flows and noticed that it is failing under the "get file content" (I have this added in to attach the document in the email to the end user) so it fails on the folder but works on the file. So it will send the file but overall shows the flow as failing.


    drishm_0-1643810187300.png

     

    Failed below (1 of 3):

     

    drishm_1-1643810240759.png

     

    But successful in the same one (3 of 3):

     

    drishm_2-1643810314354.png

     

  • Expiscornovus Profile Picture
    33,189 Most Valuable Professional on at

    Hi @drishm,

     

    Like you mentioned, trying to use a Get File Content on a folder will generate an error. You can add a condition before the Get File Content to avoid this. Check if the IsFolder boolean field value is equal to false.

     

    Below is an example of that approach

     

    getfilecontent_isfolder.png

  • drishm Profile Picture
    on at

    Hi @Expiscornovus ,

     

    So that step works 🙂 but it seems to be failing now on another previous step that worked. This is where it looks at the date the file was uploaded to send the email reminder on the next month on the same date though. It did not fail before.

    "Unable to process template language expressions in action 'Compose_the_short_string' inputs at line '0' and column '0': 'The template language function 'substring' parameter is out of range: 'start index' must be non-negative integer and should be less than the length of the string. Please see https://aka.ms/logicexpressions#substring for usage details.'."

     

    drishm_0-1643882724075.png

    drishm_1-1643882767676.png

     

     

  • VictorIvanidze Profile Picture
    13,073 on at

    You have to check also the DayOfMonth variable length.

  • DryMouse555 Profile Picture
    31 on at

    Hi, after you identify that there is a file in the folder, how to read it? like after getting properties step, how to read the file.
    My input is 

    substringof('.csv',FileLeafRef) in Get File (Properties only)
    I can see the file name in the output of the properties action, but how to read that file and get contents of that file?

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

#2
Tomac Profile Picture

Tomac 405 Moderator

#3
abm abm Profile Picture

abm abm 252 Most Valuable Professional

Last 30 days Overall leaderboard