Learn with

Expressions & Variables Example

Expression and Variable in Real world Example

Use Case: Formatting Date and Time

Step 1: Trigger the Flow

Create a new flow with any trigger that suits your scenario. We have taken manual trigger for this example.

Step 2: Get the Current Date and Time

Add an action to initialize a variable with String type and set it to the current date and time using the "utcNow()" expression.

Step 3: Format the Date and Time

To make the date and time more user-friendly, add a "Compose" action to format the stored date and time variable. Use the expression formatDateTime(variables('varCurrentDateTime'),'YYYY-MM-DD HH:mm:ss') to format the date and time in the desired way.

Step 4: You can test this flow to see output or directly Use the Formatted Data

Now that you have a nicely formatted date and time, you can use this data in subsequent actions. For example, you might want to send an email with the formatted date and time or update a record in a data source.