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 / Weekly Power automate ...
Power Automate
Unanswered

Weekly Power automate email or teams post of list of Sharepoint Library subfolder folders created

(0) ShareShare
ReportReport
Posted on by 78

Hello all,

So at present I have a teams message sent every time a new folder is created in the top folder called Incoming in Sharepoint Library.

The folders are named with date backwards and title of what is inside.

My flow only runs on condition that it is a folder and the folder name starts with the number of the year i.e. 230901 Test folder.

So there isn't hundreds of messages sent out if a folder contains lots of files.

 

Given the amount of folders we create at work, I found a way once to create a HTML table in an email which lists the columns NAME, FROM as a hyperlink, so it takes a person to the folder. I can't remember how to do it, but recently I create a new test flow to try and get my flow to work, I have it sent to my email address to test, see below:

 

buro2020_0-1694787223115.png

This flow only sent an email of one folder being created all week, but I don't know if there is anyway of getting the flow to look into all the subfolders

 

buro2020_1-1694787437317.pngburo2020_2-1694787459955.png

The timestamp is look back over 7 days from the day the flow runs, I thought it would have returned lots of folders, but the email didn't.

buro2020_3-1694787554053.png

it showed one subfolder which isn't correct, and the columns From and Assets are blank (this is correct since it picked up a subfolder which wasn't date stamped in the title, but it didn't pick up any other subfolders in the sharepoint library folder of Incoming.

 

Our folder structure is set up

Top folder: Incoming

Subfolder: Name of sender

- subfolders of the name of sender will be the date stamped titled folders: 230901 folder name

 

We can't change it at this point.

I don't have any conditions in this flow at the moment, so it ran as the flow above.

 

any help would be appreciated

Categories:
I have the same question (0)
  • creativeopinion Profile Picture
    10,502 Super User 2025 Season 2 on at

    @buro2020 The Get Files (properties only) action returns files and folders. In this YT Short I show how to use a Filter Query to return files only. 

     

    In your case, since you want to return folders only, set the number to 1. Before you even add the Send an email action to your flow, I would recommend building and testing it out first. 

    Get Files (properties only) – Return Folders

    Add a filter query to your action and include a Compose action below to count the number of folders returned.

    creativeopinion_0-1694793425776.png

    Run a test to confirm the number of items returned.

     

    You shouldn't need the Get folder metadata action as the Get files (properties only) action will return the metadata. Take a look at the outputs. 

     

    Create a Dynamic Date

    I would recommend using a few actions to create a dynamic date which you can use to check against the Folder Name (eg. 230901 Test folder). The Scope action is optional, however I find it can come in handy if you need to quickly copy these actions to use in different flows.

     

    creativeopinion_0-1695046538323.png

     

    Add a Convert time zone action to convert the current time to your local time zone. In the Base time field, insert the utcNow() function. Select (UTC) Coordinated Universal Time as the Source Time Zone. For the Destination Time Zone, you can select your local time zone. For the Format String select Round-Trip

    creativeopinion_2-1694793615542.png

     

    Next add a Compose action to store the number of days you'd like to add/remove from the current date. A positive number will add days, a negative number will subtract days. In your case, enter -7. This Compose action is optional as this number can be entered directly into the addDays() function if you prefer. 

     

    However, by using a Compose action to store the number of days to add/remove you can easily alter this expression by editing the Compose action with the number of days. 

    creativeopinion_1-1695046589970.png

     

    Add another Compose action to store today's date. This is optional, but it can help with troubleshooting and it also allows you to format today's date to be used elsewhere in your flow.

    Use an expression and insert the Converted time dynamic content from the Convert Time Zone Action. 

    formatDateTime(body('Convert_time_zone'), 'yyyy-MM-dd')

    creativeopinion_4-1694793615549.png

     

    Add one more Compose action to store the dynamic date. This will be the date that was 7 days ago. You'll need another expression. Use the addDays() function. It takes 3 parameters.

    addDays([date to add/remove days from], [number of days to add/remove], [date format] )

    I've used the dynamic content from the Compose actions above in my expression. This is what my expression looks like:

    addDays(outputs('Compose_-_Today''s_Month_and_Day'), outputs('Compose_-_Days_to_Add_or_Remove'), 'yyMMdd')

    Important: The date format should match the date format in your folder name.

    creativeopinion_2-1695046726477.png

     

    Run a test to confirm the outputs of the the Compose action above. 

    My output looks like this.

    creativeopinion_3-1695046887674.png

    Filter Array

    Add a Filter Array action to your flow. You'll use this action to check for any folders that start with the dynamic date stored in the Compose action above.

     

    In the From field, insert the value dynamic content from the Get Items action. 

    creativeopinion_4-1695046981015.png

     

    In the first value field insert the Name dynamic content from the Get Items action. Change the operator to starts with and in the second value field insert the outputs from the Compose action that is storing the dynamic date.

    creativeopinion_5-1695047014247.png

     

    Compose Filtered Count

    Add a Compose action to store the number of folders returned. This Compose action is optional however, it does help when it comes to troubleshooting and you can also use the number returned in a condition action. 

     

    Insert an expression and use the length() function to store the body dynamic content from the Filter Array action. 

    creativeopinion_7-1695047223323.png

     

    Hope this helps!

    If I helped you solve your problem—please mark my post as a solution ✅.
    Consider giving me a 👍 if you liked my response!

    👉 Watch my tutorials on YouTube
    👉 Tips and Tricks on TikTok

     

  • buro2020 Profile Picture
    78 on at

    Hi,

    Thank you, it work for getting the list of folders but the flow did not return a list of anything modified recently, it returned a list of folders created last year. so I am not sure what to modify in the flow to change that, so it is and it isn't a solution.

    I still have to get the list to show folders only and starting with the year digits only as the flow returned other folders and files within them, the asset column metadata and make the title a hyperlink to the folder, did not perform as I expected as it didn't do the hyperlinks, but the asset column is blank but that is fine for these folders since there was no data for them anyway.

    Any help on that would be appreciated.

    Wayne

  • creativeopinion Profile Picture
    10,502 Super User 2025 Season 2 on at

    @buro2020 I may have missed something in your original post. I was under the impression that you were checking for the modified date on the folder and not the date in the folder name. I have adjusted the instructions from my original post. 

     

    You'll have to adjust the dynamic date action and add a Filter Array action to your flow. Hope this helps!

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

#2
Tomac Profile Picture

Tomac 406 Moderator

#3
abm abm Profile Picture

abm abm 245 Most Valuable Professional

Last 30 days Overall leaderboard