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 Platform Community / Forums / Power Automate / Art of the Possible: A...
Power Automate
Unanswered

Art of the Possible: Automatic Creation of Properly Named Folder and Contained Files

(0) ShareShare
ReportReport
Posted on by

Hello,

 

I am wondering if Microsoft Flow is capable of a process that I want to automate in OneDrive for Business. Roughly, it is as follows.

  1. Right click on a folder named "Mmm yyyy Data" in OneDrive for Business
  2. Select Flow
  3. Flow processes as follows:
    1. Creates new folder based on next month and updates year if needed, or prompts user for that input via a drop down/calendar
    2. For each Excel file within the old folder, place in new folder with these edits:
      1. (psuedo-code) new file name = left(x) & [three character desired month] & " " & [four digit desired year]
      2. new file content = old file content
      3. (nice to have) executes 'file contents update' macro in Excel [still to be coded]
      4. moves to next file in old folder until all have been processed

Excel file name facts:

  • Examples: "blah blah blah Dec 2018.xlsx" "blah blah blah Jan 2019.xlsx" "blah blah blah Feb 2019.xlsx"
  • The only thing changing is the three character month and four digit year.
  • That's eight characters when you include the space between these.
  • These always occur at the end of the string.
  • So take the length of the original name and subtract 8 to get number of characters to take from the beginning of original file name for the new file name, variable x mentioned in 3.2.1 above.

The above is something that I could figure out how to do with a script to run in Windows; but I'm completely new to Microsoft Flow and just want to know if it's worth my time to pursue this. If folks can point me in the right direction for what they think are the tricky bits or let me know which bits aren't possible, I'd greatly appreciate it.

Warm regards,

Alexa

Categories:
I have the same question (0)
  • v-zhos-msft Profile Picture
    on at
    Re: Art of the Possible: Automatic Creation of Properly Named Folder and Contained Files

    Hi @Anonymous ,

    First of all, there is no action action for you to select a folder in flow.

    So you can't get the folder metadata.

    Second, there is also no action about create a new folder currently in flow.

    However, you get the file in a folder with the action 'List files in folder'.

    Then use the 'Copy file' action to copy the file to another folder with the name you want.7.PNG

    If you want to learn hwo to rename the file with the next month date, please feel free to feedback.

    Best Regards,

    Community Support Team _ Zhongys

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

     

  • Community Power Platform Member Profile Picture
    on at
    Re: Art of the Possible: Automatic Creation of Properly Named Folder and Contained Files

    @v-zhos-msftah okay, and thank you for your quick reply to my post. This helps a lot and could be workable.

     

    How would I start with incrementing the month [and year, if needed]?

  • Community Power Platform Member Profile Picture
    on at
    Re: Art of the Possible: Automatic Creation of Properly Named Folder and Contained Files

    Hello @v-zhos-msft and others,

     

    I just realized that implementing the "copy files" Flow would be more cumbersome than a simple Ctrl+C and Ctrl+V. If I were to pass it along to someone else, they'd need to: manually create the new folder, hard code the old folder to copy files from, and potentially have trouble with proper renaming. I'd appreciate any further input; but I think I'll move forward with making a script outside of Flow.

     

    Thanks,

    Alexa

  • Community Power Platform Member Profile Picture
    on at
    Re: Art of the Possible: Automatic Creation of Properly Named Folder and Contained Files

    Also, there is a bug in this forum. I've gotten an email that something that I did not mark as the solution was marked as the solution.

     

    soln msg.PNG

  • v-zhos-msft Profile Picture
    on at
    Re: Art of the Possible: Automatic Creation of Properly Named Folder and Contained Files

    Hi @Anonymous ,

    Sorry for that, I accidentally clicked the â€˜Accept as solution’ button.

    So you got the solution email.

    It seems you want to incrementing the month and year.

    Please take a reference of 'Date and time functions' in flow:

    https://docs.microsoft.com/en-us/azure/logic-apps/workflow-definition-language-functions-reference#date-and-time-functions

    Best Regards,

    Community Support Team _ Zhongys

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

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

#2
Tomac Profile Picture

Tomac 456 Moderator

#3
abm abm Profile Picture

abm abm 243 Most Valuable Professional

Last 30 days Overall leaderboard