cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Anonymous
Not applicable

Transform SQL Date variable into Text

I am building a flow where it takes info from SQL Database and sends an email.

 

1.png

 

And it works great:

 

2.png

 

However, I would like to transform the date into a nice format (Something like 12 Jun 2018 instead of 2018-06-12T00:00:00Z or at least to just 2018-06-12).

 

I am very familiar with PowerApps and there I would just use Text() function to transform date into nice date formats. Is there an equivalent function I can use in Flow?

1 ACCEPTED SOLUTION

Accepted Solutions
Community Support Team
Community Support Team

Re: Transform SQL Date variable into Text

Hi @Anonymous,

 

You could take a try with expresssion "formatDateTime()" to transform the  2018-06-12T00:00:00Z to 2018-06-12.

 

I have made a test on my side and have created a flow as below:

Capture.PNG

 

The expression in the email as below:

formatDateTime(body('Current_time'),'yyyy-MM-dd')

The flow would run successfully as below:

Capture.PNG

 

 

You could refer to link below to learn more about the workflow definition language:

https://docs.microsoft.com/en-us/azure/logic-apps/logic-apps-workflow-definition-language

 

 

Best regards,

Alice

 

 

View solution in original post

2 REPLIES 2
Community Support Team
Community Support Team

Re: Transform SQL Date variable into Text

Hi @Anonymous,

 

You could take a try with expresssion "formatDateTime()" to transform the  2018-06-12T00:00:00Z to 2018-06-12.

 

I have made a test on my side and have created a flow as below:

Capture.PNG

 

The expression in the email as below:

formatDateTime(body('Current_time'),'yyyy-MM-dd')

The flow would run successfully as below:

Capture.PNG

 

 

You could refer to link below to learn more about the workflow definition language:

https://docs.microsoft.com/en-us/azure/logic-apps/logic-apps-workflow-definition-language

 

 

Best regards,

Alice

 

 

View solution in original post

Anonymous
Not applicable

Re: Transform SQL Date variable into Text

@v-yuazh-msft

 

Thank you Alice, this is exactly what I was looking for.

 

Is there a list of all available date time format strings?

 

I have tried 'dd/mmm/yyyy' which works with PowerApps Text() function but does not work with the Flow.

Helpful resources

Announcements
firstImage

New & Improved Power Automate Community Cookbook

We've updated and improved the layout and uploading format of the Power Automate Cookbook!

thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

firstImage

Incoming: New and improved badges!

We've given our badges an overhaul and also added some brand new ones!

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

sixthImage

Power Platform World Tour

Find out where you can attend!

seventhimage

Webinars & Video Gallery

Watch & learn from the Power Automate Community Video Gallery!

Top Solution Authors
Top Kudoed Authors (Last 30 Days)
Users online (4,047)