Flow / Power Automate - Manipulate Dynamic Content with Power FX Video

Learn to automate file renaming in OneDrive for Business using Power FX functions. Create a flow to handle dynamic content, store file details, and apply a specific naming convention. Utilize variables, Power FX date and time functions, and predefined actions to achieve seamless renaming. Watch as the file is automatically renamed according to the desired convention, providing an efficient and fully operational flow.

  • 03:59
  • 37 views

Objectifs :

This tutorial aims to teach users how to handle dynamic content using Power FX functions to automate the renaming of files uploaded to OneDrive for Business according to a specific naming convention.


Chapitres :

  1. Introduction to Dynamic Content Handling
    In this tutorial, we will explore how to manage dynamic content using Power FX functions. The focus will be on automating the renaming of files uploaded to OneDrive for Business, following a specific naming convention that includes the user's name, month, year, and the file name in lowercase.
  2. Setting Up the Flow
    To begin, we will create a new flow using OneDrive for Business. It is crucial to select 'OneDrive for Business' and not just 'OneDrive,' which refers to a personal drive. For this tutorial, we will limit the renaming process to a folder named 'Training Folder' and its subfolders.
  3. Configuring Advanced Options
    Utilize the advanced options to include subfolders and set a maximum delay of one minute for the trigger. This will allow us to manipulate the information of the uploaded file effectively.
  4. Accessing File Metadata
    Add the 'Get File Metadata' action to access more details about the file, which we will refer to by its ID. This step is essential for the subsequent actions related to the defined naming convention.
  5. Using Variables for File Information
    You will need to use variables to store the outcomes of the processes. Start by initializing your first variable to retrieve the month and year associated with the file's modification date. Set this variable's type to text and rename the block for clarity.
  6. Applying Power FX Functions
    Utilize Power FX functions, particularly from the date and time category. The 'Format Date Time' function will allow you to apply a specific format using the dynamic content related to the modification date extracted from the metadata.
  7. Creating the Second Variable
    Next, create your second variable, also of text type, to store the folder path for renaming. This path will be retrieved from OneDrive, but it will also include the file name you wish to rename. To isolate the folder path, use the 'Replace' function to remove the file name from the complete path.
  8. Constructing the Final File Name
    Proceed to construct the final name of your file using the 'Compose' action. Populate this action with the variable containing the folder path, the name of the user who modified or created the file, and the month-year date variable. Finally, convert the file name to lowercase using the Power FX 'ToLower' function.
  9. Finalizing the Renaming Action
    To finalize the renaming action, find the corresponding OneDrive for Business action. Specify the ID of the concerned file and use the path property with the content of your compose action, which contains both the target folder and the desired naming convention. If a file with the same name already exists, you can choose to replace it.
  10. Testing the Flow
    Save and test your flow. In the designated folder within your OneDrive, create an Excel file with a random name in uppercase and wait for the flow to execute. Check the folder to confirm that the file has been automatically renamed according to the desired naming convention.
  11. Conclusion
    Congratulations! Your flow is now fully operational, successfully renaming files according to the specified naming convention. This automation not only saves time but also ensures consistency in file naming.

FAQ :

What is Power FX and how is it used?

Power FX is a low-code programming language used in Microsoft Power Platform. It allows users to create custom logic and automate tasks, making it easier to handle dynamic content and workflows.

What is the difference between OneDrive and OneDrive for Business?

OneDrive is a personal cloud storage service, while OneDrive for Business is designed for organizational use, providing additional features for collaboration and file management within a business context.

How can I automate file renaming in OneDrive?

You can automate file renaming in OneDrive using Power Automate by creating a flow that triggers on file uploads, retrieves file metadata, and applies a naming convention based on user-defined variables.

What are variables in Power Automate?

Variables in Power Automate are storage locations that hold data values. They can be initialized and modified throughout the flow to manage data dynamically.

What should I do if a file with the same name already exists?

If a file with the same name already exists, you can configure your flow to replace it by specifying the appropriate action in OneDrive for Business.

How do I ensure my file names are in lowercase?

You can ensure your file names are in lowercase by using the ToLower function in Power FX, which converts any string to lowercase format.


Quelques cas d'usages :

Automating File Management in a Corporate Environment

In a corporate setting, automating the renaming of files uploaded to OneDrive for Business can streamline document management. For instance, when employees upload reports, the flow can rename them according to a predefined convention, ensuring consistency and easy retrieval.

Organizing Training Materials

Training departments can use this flow to automatically rename training materials uploaded to a specific folder in OneDrive. By including the trainer's name, date, and topic in the file name, it enhances organization and accessibility for future reference.

Maintaining Version Control

In software development, teams can automate the renaming of versioned files uploaded to OneDrive. By incorporating version numbers and modification dates into the file names, teams can easily track changes and maintain version control.

Streamlining Document Submission Processes

Organizations can implement this flow to manage document submissions from clients or partners. By automatically renaming submitted files based on the submitter's name and submission date, it simplifies tracking and processing of incoming documents.


Glossaire :

Power FX

A low-code programming language used in Microsoft Power Platform to create custom logic and automate tasks.

OneDrive for Business

A cloud storage service from Microsoft that is designed for business use, allowing users to store, share, and collaborate on files.

Dynamic Content

Content that changes based on user input or other variables, allowing for more personalized and relevant experiences.

File Metadata

Information about a file, such as its name, size, type, and modification date, which can be used to manage and organize files.

Variables

Storage locations in programming that hold data values which can be changed during the execution of a program.

Compose Action

An action in Power Automate that allows users to create and manipulate data by combining multiple inputs into a single output.

Replace Function

A function used to substitute a specified substring within a string with another substring, often used to modify file paths or names.

ToLower Function

A Power FX function that converts a string to lowercase, ensuring uniformity in text formatting.

Naming Convention

A systematic method for naming files or variables that helps in organizing and identifying them easily.

00:00:04
we will see how to handle dynamic content using power FX functions.
00:00:08
This flow will automate the renaming of a file
00:00:10
uploaded to onedrive according to the following naming convention,
00:00:14
user's name, month, year of the file and file name. In lower case,
00:00:20
let's dive into the details by creating a new flow using onedrive for business.
00:00:26
Be careful not to select one drive alone which refers to a personal drive
00:00:30
here. It is specifically onedrive for business.
00:00:36
For this tutorial,
00:00:37
we will limit the renaming process to a folder in
00:00:40
the drive named training folder and its sub folders.
00:00:44
Utilizing the advanced options
00:00:47
include sub folders
00:00:50
and also set a maximum delay of one minute for the trigger
00:00:54
to manipulate the information of your file.
00:00:58
Add the get file metadata action which allows access to more details
00:01:02
about the file which we will refer to here by its ID.
00:01:07
For the following actions related to the
00:01:09
manipulations tied to the defined naming convention.
00:01:12
You will need to use variables to store the outcome of these processes,
00:01:15
initialize your first variable which will retrieve the month
00:01:19
and year associated with the modification of your file
00:01:23
name. This variable and set its type to text.
00:01:26
Take this opportunity to rename the block for clarity.
00:01:30
Then use the power FX functions,
00:01:34
particularly those from the date and time category.
00:01:37
The format date time function will allow you to apply a specific format by using
00:01:42
the dynamic content related to the modification date
00:01:45
of your file extracted from the metadata.
00:01:48
Conclude by adding the desired date, format, month year,
00:01:55
directly proceed with creating your second variable.
00:01:58
Also of text type which will store the folder path for renaming.
00:02:01
This is specific here because it is possible to retrieve the path of a onedrive file.
00:02:06
However, the path also includes the file name, you wish to rename.
00:02:10
Therefore you need to remove the file name from the
00:02:13
path to keep only the folder where this file is stored
00:02:17
to do this, use the replace function which starting from the complete path
00:02:23
should find the file name alone retrievable through the
00:02:26
display name content which only returns the file name,
00:02:30
replace it with an empty string.
00:02:32
Your variable will thus return the folder path without the file name
00:02:38
before renaming.
00:02:39
Go through an intermediate step aimed at constructing the final name of your file.
00:02:44
Use the predefined compose action which you populate
00:02:48
in order with the variable containing the folder path.
00:02:52
The name of the user who modified or created the file, the month year date, variable
00:02:58
lastly convert the file name to lowercase using the power FX to lower function.
00:03:07
You only need to finalize the renaming action by
00:03:10
finding the corresponding one drive for business action,
00:03:17
specify the id of the concerned file and use the path property with the content
00:03:22
of your compose action containing both the
00:03:24
target folder and the desired naming convention.
00:03:27
If a file with the same name already exists, you can as in this case, replace it,
00:03:34
save and test. Now
00:03:37
in the concerned folder within your onedrive, create an Excel file.
00:03:40
For example, with a random name in uppercase and wait
00:03:46
the flow executes correctly,
00:03:49
check the folder.
00:03:51
Perfect. The file has been automatically renamed.
00:03:53
According to the desired naming convention,
00:03:56
your flow is fully operational.

No elements match your search in this video....
Do another search or back to content !

 

Mandarine AI: CE QUI POURRAIT VOUS INTÉRESSER

Reminder

Show