Create a simple flow

Completed

In this unit, you'll develop a flow that converts dates in the dd/MM/yyyy format, commonly used in Europe, to the American format (MM/dd/yyyy). The flow will prompt users to enter a date and it will display the converted date in a message box.

Note

Το make the flow work with date formats used in other regions, replace the presented date formats with the ones you want to use.

To create the flow:

  1. Launch Power Automate for desktop and select the New flow button in the console.

    Screenshot of the New flow button in the console.

  2. Populate a name for the flow and then select the Create button. In this example, the flow is named Date conversion.

    Screenshot of the Build a flow dialog box.

  3. When the flow designer is launched, use the actions pane to search for and select the Display input dialog action.

    Screenshot of search in Actions pane.

    Note

    If the searching term matches a module name, the results display the module expanded with all its actions available. Searching also returns partial matches, but requires at least two provided characters.

    You can either double-click on this action or you can drag and drop from the actions to the main pane.

    Screenshot of drag and drop.

  4. Set the action to prompt users to enter a date in the European format. Then select Save.

    Screenshot of the Display input dialog action.

  5. Deploy a Convert text to datetime action to convert the entered text to a datetime variable. The text represents the European date format, so configure the appropriate custom format in the action's properties. Select your variable for UserInput as the text to convert, ensure the toggle for custom format is on, and enter dd/MM/yyyy as the custom format. Then select Save.

    Screenshot of the Convert text to datetime action.

  6. To convert the datetime variable to the U.S. date format, use the Convert datetime to text action with the appropriate custom format in its properties. Use your variable for TextAsDateTime as the Datetime to convert, select Custom as the format to use, and input MM/dd/yyyy as the custom format. Notice how the Sample bar shows what your formatted date will appear as. Then select Save.

    Screenshot of the Convert datetime to text action.

  7. Use the Display message action to display the converted date in a message box. Input Converted date in the title field. For message to display input, enter The date in the American format is: and then select your variable for FormattedDateTime. The completed step should resemble the image below.

    Screenshot of the Display message action.

  8. To test the flow, select the Run button. You will see a popup appear on your screen. Populate a date in the European format (dd/MM/yyyy), and verify that the flow displays the appropriate American date format. To check how every single action is implemented, run the flow step by step using the Run next action button.

  9. If the flow runs as expected, select Save and then close the flow designer.

    Screenshot of the Save button in the flow designer.

  10. Now, you can also run your flow manually through the Run button in the console. If you want to stop running the flow, select the Stop button.

    Screenshot of the run button in the console.

    Note

    You may notice a difference in the day number when converting from European to U.S. That's because Power Automate saves the date with a timestamp a value of 12:00 AM. The day value in the U.S. will be less than that, giving you one day less than the European date.