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

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
  • 209 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 !

 

00:00:02
Neste tutorial,
00:00:04
veremos como lidar com conteúdo dinâmico usando funções power FX.
00:00:08
Este fluxo irá automatizar a renomeação de um ficheiro
00:00:10
carregado no onedrive de acordo com a seguinte convenção de nomenclatura,
00:00:14
nome do utilizador, mês, ano do ficheiro e nome do ficheiro. Em minúsculas,
00:00:20
vamos mergulhar nos detalhes criando um novo fluxo usando o onedrive para empresas.
00:00:26
Tenha cuidado para não selecionar apenas uma unidade que se refira a uma unidade pessoal
00:00:30
aqui. É especificamente o onedrive para as empresas.
00:00:36
Para este tutorial,
00:00:37
limitaremos o processo de renomeação a uma pasta em
00:00:40
a unidade denominada pasta de treino e respectivas subpastas.
00:00:44
Utilizando as opções avançadas
00:00:47
incluir subpastas
00:00:50
e também definir um atraso máximo de um minuto para o gatilho
00:00:54
para manipular as informações do seu ficheiro.
00:00:58
Adicione a ação obter metadados do arquivo que permite o acesso a mais detalhes
00:01:02
sobre o ficheiro a que nos referiremos aqui pelo seu ID.
00:01:07
Para as seguintes ações relacionadas com o
00:01:09
manipulações ligadas à convenção de nomenclatura definida.
00:01:12
Terá de utilizar variáveis para armazenar o resultado destes processos,
00:01:15
inicializar a sua primeira variável que irá recuperar o mês
00:01:19
e ano associado à modificação do seu ficheiro
00:01:23
nome. Esta variável e defina o seu tipo para texto.
00:01:26
Aproveite esta oportunidade para renomear o bloco para maior clareza.
00:01:30
Em seguida, use as funções Power FX,
00:01:34
nomeadamente as da categoria de data e hora.
00:01:37
A função formatar data e hora permitir-lhe-á aplicar um formato específico utilizando
00:01:42
o conteúdo dinâmico relacionado com a data de modificação
00:01:45
do seu ficheiro extraído dos metadados.
00:01:48
Concluir adicionando a data desejada, formato, mês, ano,
00:01:55
prossiga diretamente com a criação da sua segunda variável.
00:01:58
Também do tipo texto que irá armazenar o caminho da pasta para renomeação.
00:02:01
Isto é específico aqui porque é possível recuperar o caminho de um ficheiro onedrive.
00:02:06
No entanto, o caminho também inclui o nome do ficheiro, que deseja renomear.
00:02:10
Por conseguinte, tem de remover o nome do ficheiro do
00:02:13
caminho para manter apenas a pasta onde este ficheiro está armazenado
00:02:17
para fazer isso, use a função replace que começa a partir do caminho completo
00:02:23
deve encontrar o nome do ficheiro sozinho recuperável através do
00:02:26
apresentar o conteúdo do nome que devolve apenas o nome do ficheiro,
00:02:30
substitua-o por uma string vazia.
00:02:32
A sua variável retornará assim o caminho da pasta sem o nome do ficheiro
00:02:38
antes de renomear.
00:02:39
Percorra uma etapa intermédia destinada a construir o nome final do seu ficheiro.
00:02:44
Utilize a acção de composição predefinida que preenche
00:02:48
em ordem com a variável que contém o caminho da pasta.
00:02:52
O nome do utilizador que modificou ou criou o ficheiro, o mês, ano, data, variável
00:02:58
por último, converta o nome do ficheiro em minúsculas utilizando a função power FX para inferior.
00:03:07
Só precisa de finalizar a ação de renomeação
00:03:10
encontrar a unidade correspondente para a acção empresarial,
00:03:17
especifique o id do arquivo em questão e use a propriedade path com o conteúdo
00:03:22
da sua acção de composição contendo ambos os
00:03:24
pasta de destino e a convenção de nomenclatura desejada.
00:03:27
Se já existir um ficheiro com o mesmo nome, pode, como neste caso, substituí-lo,
00:03:34
salvar e testar. Agora
00:03:37
na pasta em questão no seu onedrive, crie um ficheiro Excel.
00:03:40
Por exemplo, com um nome aleatório em caixa alta e aguarde
00:03:46
o fluxo é executado correctamente,
00:03:49
verifique a pasta.
00:03:51
Perfeito. O ficheiro foi renomeado automaticamente.
00:03:53
De acordo com a convenção de nomenclatura desejada,
00:03:56
o seu fluxo está totalmente operacional.

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