How to Convert Number to Date in Power Automate?

Do you want to convert a number to date in Power Automate? In this tutorial, we will see how to convert numbers to date in Power Automate.

Here, we will cover the topics below

  • How to convert number to date in Power Automate
  • How to convert integer to date in Power Automate
  • How to convert serial number to date in Power Automate

Convert number to date in Power Automate

Here, we will see how to convert numbers to date in Power Automate.

For example, we have a number, i.e., 44307, and when we convert this number to the date format ‘dd-MMM-YY ‘, the result will be 21-Apr-2021.

To do this in Power Automate, follow the below steps:

1. Open Power Automate Cloud, click on +Create and select Instant Cloud Flow.

How to convert number to date Microsoft Power Automate

Then, provide the flow name and select Manually trigger a flow action. Then click on Create.

Power automate convert number to date

You can see the “Manually trigger a flow” action is added to the canvas. Next, click on +Add an input option -> select the ‘Number’ field.

convert number to date in Power Automate

2. We will convert this number to date; for this, click on +New step -> select Compose action. Then provide the below information:

  • Inputs: Provide the below expression:
addDays('1899-12-30',triggerBody()['number'], 'dd-MMM-yyyy')
How to convert number to date in Power Automate

3. Now save the flow and run the flow manually. Then, enter the number you need to convert to date.

convert number to date  Power Automate

This is how to convert the number to date in Power Automate.

See also  Power Automate IF Expression [With 51 Examples]

Convert integer to date in Power Automate

Here, we will see how to convert integers to date in Power Automate.

For example, we have a number of string type ‘44327’, and then we will convert it to date. We need to convert the string to date in Power Automate for this.

To do this in Power Automate, follow the below steps:

1. Open Power Automate Cloud, click +Create and select Instant Cloud Flow.

How to convert integer to date Microsoft Power Automate

Then, provide the flow name and select Manually trigger a flow action. Then click on Create.

Power automate convert integer to date

Now you can see the “Manually trigger a flow” action is added to the canvas in Power Automate. Next, click on Add an input -> select the Text icon to add a text field to the action.

convert integer to date Power Automate

2. We will convert this number to date; for this, click on +New step -> select Compose action. Then provide the below information:

  • Inputs: Provide the below expression:
addDays('1899-12-30',int(triggerBody()['text']), 'dd-MMM-yyyy')
convert integer to date in Power Automate

3. Now save the flow and run the flow manually. Then, enter the text you need to convert to date.

convert integer to date Microsoft Power Automate

This is how to convert integers to date in Power Automate.

Convert serial number to date in Power Automate

Here, we will see how to convert serial numbers to date in Power Automate.

For example, we have an Excel sheet containing information related to Employee Birthdays. The columns are listed below.

  • Employee Name
  • Employee Email
  • Employee DOB
MS Power Automate convert serial number to date

We will get the information from Excel and write it into the SharePoint list i.e., Employee Birthday. Contains the below fields:

  • Title: Single line of text
  • Employee Name: Person
  • Employee Email: Single line of text
  • Employee DOB: Date and time
MS Power Automate convert serial number to date format

When we get the details from Excel, in Power Automate the employee DOB is coming in serial number like below.

How to convert serial number to date in Power Automate

So, here, we will create a flow in Power Automate that we will convert the number to date.

See also  How to Convert True to Yes in Power Automate?

1. Open Power Automate Cloud, click +Create and select Instant Cloud Flow.

How to convert number to date Microsoft Power Automate

Then, provide the flow name and select the ‘Manually trigger a flow” action. Then click on Create.

Power automate convert serial number to date

Now you can see the “Manually trigger a flow” action is added to the canvas in Power Automate.

Power Automate convert serial number to date

2. Next, we will get the information from the Excel sheet; click on the +New step -> select List rows present in a table action. Then, provide the information below.

  • Location: Provide the Location of Excel
  • Document Library: Provide the Document library where Excel is available
  • File: Select the Excel file.
  • Table: Select the table from the drop-down.
Convert serial number to date Power Automate

3. Next, initialize the variable that we will use. Store the date; for this, click on +New step -> select Initialize variable action. Then provide the below information:

  • Name: Provide the name as the Date.
  • Type: Select the type a string
Convert serial number to date Microsoft Power Automate

4. Now, we will convert the number to date; for this, click on Add an action -> select Set variable action. Then provide the below information:

  • Name: Select the variable name
  • Value: Provide the value as an expression. Also, it will automatically add Apply to each action in Power Automate.
addDays('1899-12-30',int(items('Apply_to_each')?['Date Of Birth']),'yyyy-MMM-dd')
How to convert serial number to date Microsoft Power Automate

5. Now, we will create an item in the SharePoint list; for this, click on Add an action -> select Create item action. Then provide the below information:

  • Site address: Provide the sharePoint site address
  • List name: Provide the Sharepoint list name
  • Title: Provide the expression as guid()
  • Employee Name Claims: Provide the Employee name from dynamic content
  • Employee Email: Provide the employee email from dynamic content.
  • Employee DOB: Select the Date variable from dynamic content.
How to convert serial number to date Power Automate

6. Now save the flow and then run the flow manually. The items are created in the SharePoint list, and the number is converted to date.

See also  Expense Reimbursement and Approval using Power Automate [SharePoint List, Microsoft Forms, Planner]
Convert serial number to date using Power Automate

This is how to convert the number to date in Power Automate.

Conclusion

In this Power Automate tutorial, we saw how to convert a number to date in Power Automate.

You may also like:

>