Flow / Power Automate - Leverage Variables with Power FX in Power Automate Tutorial

Discover the power of leveraging variables with Power FX in Power Automate. Learn how to list channel files based on date constraints, transform monthly flows into weekly ones, and use Power FX functions for dynamic date manipulations. Explore the comprehensive tutorial for effective flow activation and message posting in your team channel. Unlock the potential of Power Automate for efficient workflow management!

  • 03:28
  • 192 views

Objectifs :

This tutorial aims to guide users through the process of utilizing Power FX functions to implement date constraints in a flow that lists files from a team's channel. By the end of this tutorial, users will be able to create a flow that only lists files created within the last seven days, transforming a monthly flow into a weekly one.


Chapitres :

  1. Introduction to Power FX Functions
    In this tutorial, we will explore Power FX functions that enable various types of calculations. Specifically, we will focus on how to apply a date constraint to a flow that lists files from a team's channel.
  2. Setting Up the Flow
    To begin, duplicate an existing flow that does not have the date constraint. This flow is from a previous tutorial. From the context menu, perform a 'Save As' and rename the copy explicitly. Once done, click on the pencil icon to edit this flow.
  3. Transforming the Flow Frequency
    This flow is currently set to run monthly. We will transform it into a weekly flow that runs every Monday at 10 a.m. In this flow, you will find a variable used to generate the list of channel files. To remain organized, change the label of the initialization block for this variable.
  4. Creating a Date Variable
    Next, add an action to generate a new variable to store the date seven days prior to the current date. Here, you will use a Power FX function via the FX button in the window. Power FX functions are categorized by themes, and it is common to search the web to determine if a function exists and to gather syntactic information.
  5. Using the Add Days Function
    In this instance, the 'Add Days' function allows you to add or subtract a number of days associated with a date. Select the function, enter the parentheses, and supply the arguments according to the expected syntax. Use the 'UTC Now' function, which dynamically refers to the current date. The second parameter, separated by a comma, will contain '-7', indicating the number of days to subtract, followed by the format parameter.
  6. Implementing Conditional Logic
    Now, in the loop processing each file from the channel, add a conditional 'If' action based on the file's creation date to populate your variable. This will list the files only if they were created on or after seven days ago, specifically the previous Monday. Retrieve the dynamic content related to the creation date by specifying 'greater than or equal to' your previously created date variable.
  7. Finalizing the Flow
    Drag the block populating the variable listing the files into the case where the condition is met. Additionally, add a second conditional block to avoid posting a team's message if no file has been added. Test your message block containing your list of files less than seven days old by specifying that it must not be empty to post the team's message, which you will drag into the condition.
  8. Testing and Activating the Flow
    On the team side, add two files from your desktop to the relevant team. All that remains is to save and test the flow. Power Automate will inform you that the flow is not active. In the list of your flows, activate it and run it in your team channel. You will see a post containing only the two newly created files. From now on, your flow is active and will post a message every Monday if needed.

FAQ :

What is Power FX and how is it used?

Power FX is a formula language used in Microsoft Power Platform for performing calculations and data manipulation. It is commonly used in flows to automate tasks and manage data effectively.

How do I create a flow that lists files from a team channel?

To create a flow that lists files from a team channel, you can duplicate an existing flow, add a date constraint to filter files created within the last seven days, and use conditional actions to manage the output.

What does the 'Add Days' function do?

The 'Add Days' function in Power FX allows you to add or subtract a specific number of days from a date. This is useful for setting date constraints in flows.

How can I test my flow after creating it?

After creating your flow, you can save and activate it. Then, run the flow in your team channel to see if it posts the expected messages based on the conditions set.

What should I do if my flow is not active?

If your flow is not active, you can activate it from the list of your flows in Power Automate. Once activated, it will run according to the schedule you have set.


Quelques cas d'usages :

Weekly File Reporting

In a corporate environment, a team can use this flow to automatically report newly created files in a channel every Monday. This ensures that team members are updated on recent contributions without manual checks.

Automated Document Management

A project manager can implement this flow to keep track of documents added to a project channel. By filtering files created in the last seven days, the manager can ensure that the team focuses on the most recent updates.

Compliance Tracking

In regulated industries, this flow can be used to monitor and report on files that meet specific criteria, such as creation dates. This helps ensure compliance with internal policies and external regulations.

Team Collaboration Enhancement

By automating file notifications, teams can enhance collaboration. This flow can be set to notify team members of new files, ensuring everyone is aware of the latest resources available.


Glossaire :

Power FX

A formula language used in Microsoft Power Platform to perform calculations and manipulate data.

Flow

An automated workflow that connects different applications and services to perform tasks without manual intervention.

Variable

A storage location identified by a name that can hold data which may change during the execution of a flow.

UTC Now

A Power FX function that returns the current date and time in Coordinated Universal Time (UTC).

Add Days Function

A Power FX function that allows you to add or subtract a specified number of days from a given date.

Conditional Action

An action in a flow that executes only if a specified condition is met.

Dynamic Content

Content that is generated at runtime based on the data available in the flow, such as file creation dates.

00:00:03
we will explore power FX functions that enable various types of calculations.
00:00:08
We will start with an existing flow that lists
00:00:11
the files of a team's channel in a message
00:00:14
adding a date constraint to it
00:00:16
specifically,
00:00:17
we will list the files from a channel only
00:00:19
if they were created within the last seven days
00:00:23
to begin, duplicate an existing flow that does not have this constraint.
00:00:28
This flow is from a previous tutorial
00:00:31
from the context menu. Perform a save as and rename the copy explicitly.
00:00:36
Once done, click on the pencil icon to edit this flow.
00:00:41
This flow is monthly and recurrent transform it
00:00:44
into a weekly flow every Monday at 10 a.m.
00:00:48
In this flow, you will find a variable used to generate the list of channel files
00:00:53
to remain organized,
00:00:54
change the label of the initialization block for this variable.
00:00:59
Next, add an action to generate a new variable
00:01:05
to store the date seven days prior to the current date.
00:01:08
Here, you will use a power FX function via the FX button
00:01:15
in the window. You will find power FX functions categorized by themes.
00:01:20
Note that there is no assistant here. Just a brief description.
00:01:24
It is common to have to search the web to
00:01:26
determine if a function exists and to gather syntactic information.
00:01:31
In this instance,
00:01:32
the add days function allows you to add or
00:01:35
subtract a number of days associated with a date.
00:01:39
Select the function enter the parentheses and supply the
00:01:42
arguments of this function according to the expected syntax.
00:01:45
Using the UTC. Now function which dynamically refers to the current date.
00:01:51
The second parameter separated by a comma will contain minus seven,
00:01:56
the number of days to subtract followed by the format parameter.
00:02:03
Now in the loop processing each file from the channel,
00:02:06
add a conditional if action based on
00:02:09
the files creation date to populate your variable
00:02:12
listing the files only if they are created on or after seven days ago.
00:02:17
That is
00:02:18
the previous Monday
00:02:21
retrieve the dynamic content related to the creation date by
00:02:24
specifying greater and equal to your previously created date.
00:02:28
Variable
00:02:30
then drag the block populating the variable,
00:02:32
listing the files into the case where the condition is met.
00:02:36
Take this opportunity to add a second conditional
00:02:39
block to avoid posting a team's message.
00:02:41
If no file has been added,
00:02:44
test your message block containing your list of files less than seven days
00:02:49
old by specifying that it must not be empty to post the team's message
00:02:54
which you will drag into the condition.
00:02:56
Also add an introductory sentence
00:03:00
on the team side, add two files from your desktop to the relevant team,
00:03:05
all that remains is to save and test the flow
00:03:09
power automate. Will inform you that the flow is not active
00:03:13
in the list of your flows, activate it and run it
00:03:16
in your team channel.
00:03:17
You will see a post containing only the two newly created files from now
00:03:22
on your flow is active and will post a message every Monday if needed.

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

 

00:00:02
Neste tutorial,
00:00:03
exploraremos funções de Power FX que permitem vários tipos de cálculos.
00:00:08
Começaremos com um fluxo existente que lista
00:00:11
os ficheiros do canal de uma equipa numa mensagem
00:00:14
adicionar uma restrição de data a ele
00:00:16
especificamente,
00:00:17
vamos listar os ficheiros de um canal apenas
00:00:19
se foram criados nos últimos sete dias
00:00:23
para começar, duplicar um fluxo existente que não tenha essa restrição.
00:00:28
Este fluxo é de um tutorial anterior
00:00:31
a partir do menu de contexto. Execute um save as e renomeie a cópia explicitamente.
00:00:36
Uma vez feito, clique no ícone de lápis para editar este fluxo.
00:00:41
Este fluxo é mensal e recorrente, transforma-o.
00:00:44
num fluxo semanal todas as segundas-feiras às 10h
00:00:48
Neste fluxo, encontrará uma variável utilizada para gerar a lista de ficheiros de canal
00:00:53
manter-se organizado,
00:00:54
alterar o rótulo do bloco de inicialização para esta variável.
00:00:59
Em seguida, adicione uma ação para gerar uma nova variável
00:01:05
para armazenar a data sete dias antes da data atual.
00:01:08
Aqui, usará uma função Power FX através do botão FX
00:01:15
na janela. Encontrará funções Power FX categorizadas por temas.
00:01:20
Note-se que não há assistente aqui. Apenas uma breve descrição.
00:01:24
É comum ter de pesquisar na web para
00:01:26
determinar se existe uma função e recolher informação sintática.
00:01:31
Neste caso,
00:01:32
a função adicionar dias permite adicionar ou
00:01:35
subtrair um número de dias associados a uma data.
00:01:39
Seleccione a função, introduza os parênteses e forneça o
00:01:42
argumentos desta função de acordo com a sintaxe esperada.
00:01:45
Utilização da UTC. Agora função que se refere dinamicamente à data atual.
00:01:51
O segundo parâmetro separado por uma vírgula conterá menos sete,
00:01:56
o número de dias a subtrair seguido do parâmetro de formato.
00:02:03
Agora, no ciclo a processar cada ficheiro do canal,
00:02:06
adicionar uma ação condicional se baseada em
00:02:09
a data de criação dos ficheiros para preencher a sua variável
00:02:12
listando os arquivos apenas se eles forem criados em ou após sete dias atrás.
00:02:17
Isto é
00:02:18
na segunda-feira anterior
00:02:21
recuperar o conteúdo dinâmico relacionado com a data de criação por
00:02:24
especificando maior e igual à data de criação anterior.
00:02:28
Variável
00:02:30
em seguida, arraste o bloco que preenche a variável,
00:02:32
enumerar os ficheiros no caso em que a condição está preenchida.
00:02:36
Aproveite esta oportunidade para adicionar um segundo condicional
00:02:39
bloquear para evitar a publicação da mensagem de uma equipa.
00:02:41
Se nenhum ficheiro tiver sido adicionado,
00:02:44
testar o seu bloco de mensagens contendo a sua lista de ficheiros em menos de sete dias
00:02:49
antigo especificando que não deve estar vazio para postar a mensagem da equipa
00:02:54
que arrastará para a condição.
00:02:56
Acrescentar ainda uma frase introdutória
00:03:00
no lado da equipa, adicione dois ficheiros do seu ambiente de trabalho à equipa relevante,
00:03:05
tudo o que resta é salvar e testar o fluxo
00:03:09
poder automatizar. Irá informá-lo que o fluxo não está ativo
00:03:13
na lista dos seus fluxos, activa-o e execute-o
00:03:16
no seu canal de equipa.
00:03:17
Irá ver uma publicação contendo apenas os dois ficheiros recém-criados a partir de agora
00:03:22
no seu fluxo está ativo e irá postar uma mensagem todas as segundas-feiras, se necessário.

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