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
Highlighted
Community Support
Community Support

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
Highlighted
Community Support
Community Support

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

Highlighted
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

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

firstImage

Join the new Power Virtual Agents Community!

We are excited to announce the launch of Power Virtual Agents Community. Check it out now!

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!

Top Solution Authors
Top Kudoed Authors
Users online (10,790)