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 / New excel file to be c...
Power Automate
Unanswered

New excel file to be created every month on SharePoint and updated daily.

(0) ShareShare
ReportReport
Posted on by 50

Hi,

I have created a flow wherein a new excel file gets created on SharePoint, every time the flow is run.

The file name being 'Output_Jan_2024' and once the file has been created, the next time flow will only update the file, till Jan ends.

At the start of next month, a new file has to be created('Output_Feb_2024') and same file gets updated till Feb ends and so on.

 

I have created the below flow so far:

 

AdyG_0-1705478797347.png

Recurrence: scheduled to run daily
File Content: ‘Compose’ action to capture the output of a new excel file.
Create File: gets the output of ‘File content’ to create an excel file.

 

AdyG_1-1705478976108.png

 


Create Table: Format as table

 

What action do I need to add to capture, if the folder already has the current month file, update the same file, else create a new?

 

Thanks.

Categories:
I have the same question (0)
  • v-jefferni Profile Picture
    on at

    Hi @AdyG ,

     

    You need a Condition control to judge if there is current month file in SP library. To achieve this, you need a Get files properties only action, then a Condition control following it. You can use Filter query in Get files action to get current month files based on file names:

    substringof(Output_formatDateTime(...), 'FileLeafRef')

    and then in Condition, checking the number of files get from above action:

    length(body('Get_files_(properties_only)')) is greater than 0

    if yes, add a row into table, if no, create file, create table then add a row into this table.

     

    Best regards,

  • AdyG Profile Picture
    50 on at

    Hi @v-jefferni,

    The 'substringof()' function is not working, it gives the below error:

     

    AdyG_0-1705494578848.png

    Also could you please help with the 'FileLeafRef', is this a column or property available on SharePoint?

     

    Thanks.

     

  • v-jefferni Profile Picture
    on at

    Hi @AdyG ,

     

    Sorry, single quotes are not needed for FileLeafRef in filter query:

    vjefferni_0-1705571605630.png

     

    FileLeafRef represents the Name column in SP library, just be used in filter query.

     

    Best regards,

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

#2
Tomac Profile Picture

Tomac 321 Moderator

#3
abm abm Profile Picture

abm abm 237 Most Valuable Professional

Last 30 days Overall leaderboard