How to Use Power Automate to Rename Files Systematically – TechRepublic | Hot Mobile Press

Image: Mark W Kaelin

In corporate work, and sometimes in personal situations, we are often asked to perform periodic, repetitive, and routine computer-related tasks. These routines (copying files, renaming files, adding rows to spreadsheets, etc.) are often performed manually by users who eventually deem it a waste of their valuable time. However, by automating these repetitive tasks, we can reduce frustration and greatly increase productivity.

SEE: The CIO’s Guide to Low-Code Platforms (TechRepublic Premium)

Power Automate, available free to Microsoft Windows 11 users, can help automate repetitive tasks by providing an easy-to-use platform for low-code solutions. This underused tool is also available to users with Windows 10 if they also happen to have a Microsoft 365 subscription. Power Automate is Microsoft’s automation solution that anyone can use. It is based on drag-and-drop code creation and is much more powerful than many users might understand or appreciate.

Use Power Automate to systematically rename files

With this short tutorial, we’ll show you the basics of creating a working Power Automate solution using the low-code building environment. For our example, we’ll create a solution that systematically renames a set of files in a folder, including subfolders, based on a set of parameters and variables that we define by selecting from simple drop-down menus.

SEE: Research: Increased use of low-code/no-code platforms poses no threat to developers (TechRepublic Premium)

If you’re running Windows 11, type automate power into the desktop search tool and select it from the results to load Power Automate. If you use Microsoft 365, you must first sign in to the Microsoft 365 website and install the desktop version from there. If you have previously created and saved Power Automate solutions, they will be listed in the application dashboard, otherwise you will see this splash (Figure A).

Welcome message in Power Automate
Figure A

For our example, click + New Flow to start the creation process. Give your new flow a meaningful name, then click Create to go to the main development screen, as shown in Figure B.

Main development screen in Power Automate
Figure B

As you can see from the list of available options on the left side of the screen, there are dozens of potential actions to take when developing solutions in Power Automate.

In our example, we will rename a set of files located in a specific subfolder (Figure C). We will add systematically _2022 to the end of each filename with a software robot that we will create in Power Automate.

Subfolders with circled items
Figure C

Since we’re working with a set of files in a folder, we need to access those folders first, so let’s first expand the Folders action item in the left navigation bar. We then drag and drop the Get Files In Folder item into the Subflow section, which then displays a dialog screen where we can define our variables (Figure D).

Arrow pointing to the variable icon in Power Automate
Figure D

The first panel lets us define which folder we want to work with, so we’ll click the folder icon and navigate to our example folder. The second field asks us to insert a filter for our files, but in our example we want to rename all files, so we leave the * as a wildcard filter for all files.

Since we will be applying our changes to subfolders as well, let’s toggle this button to the On position.

Figure E shows us what this screen looks like when filled. Note that the output of this action will be a variable named Files, created by default. We could change this name if we wanted, but that’s fine for our purposes.

Filter menu in Power Automate
Figure E

Click Save to complete this part of the routine. Our software robot will now retrieve all files from our designated folder and subfolders. The next step is to systematically rename these filenames.

From the Actions navigation bar, expand Files, then drag and drop the Rename File(s) item into the Flow section under our previous routine, where you’ll be presented with another set of variable settings, like shown in Figure F.

Variable settings in Power Automate
Figure F

The first field asks us which files we want to rename. This is where the power of automation and Power Automate comes into play. We want to rename the files retrieved by the routine defined in the previous step, so we click on the variable icon ({x}) and choose files (Figure G).

Variable icon circled in Power Automate
Figure G

In the next field (Figure H), we need to decide which renaming scheme we want to apply. For our example we will add _2022 to the end of each filename, leaving the extension unchanged.

Renaming configurations in Power Automate
Figure H

As you can see, we have chosen to do nothing when we come across a file with a name that already exists. And since we don’t need the output for another step in our routine, we decided not to create another variable. Click Save when you are satisfied with your answers to the questions.

Our sample software robot is now complete. Click Run to start the automated routine, then review the results in our folders as shown in Figure I.

Power Automate application results circled
Figure I

Of course, there are many tools that can rename files; However, Power Automate is a robust, free, low-code tool that can be used to automate tasks in an operating environment composed of Windows, Microsoft 365, and Azure.

Power Automate can work with Word documents, Excel spreadsheets, and other Microsoft software to help users update reports, modify documents, reply to emails, and a variety of other routine tasks. Power Automate is a currently underused tool, and users who want to differentiate themselves from their competitors should learn to use it.

Leave a Comment