cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
hxiaSMMA
Level: Powered On

Convert Datetime using "convert time zone" action

Hi all,

 

I am able to convert the time from 10/08/2019 to

 2019-10-07T11:00:00.0000000Z

I want my final output to be

2019-10-07T11:00:00.0000

So basically removing the last 4 characters.

 

How would I do that?

 

Thank you 

1 ACCEPTED SOLUTION

Accepted Solutions
Dual Super User
Dual Super User

Re: Convert Datetime using "convert time zone" action

Hi @hxiaSMMA 

 

dynamiccontentreference - that is a dummy text I added for you to replace it with the field which stores the actual value 

 

so remove this from the expression and then swicth to dynamic content (WHILE IN EXPRESSION WINDOW - dynamic content is right to the left of it as a tab) and select the field which has the date value you want the last 4 chars to be replaced

 

--------------------------------------------------------------------------------
If this post helps answer your question, please click on “Accept as Solution” to help other members find it more quickly. If you thought this post was helpful, please give it a Thumbs Up.

 

View solution in original post

9 REPLIES 9
Dual Super User
Dual Super User

Re: Convert Datetime using "convert time zone" action

Hi @hxiaSMMA 

 

Use expressions

 

replace(dynamiccontentdatevalue,'000Z','')
 
or
 
substring(dynamiccontentdatevalue,0,sub(length(dynamiccontentdatevalue),4))
 
--------------------------------------------------------------------------------
If this post helps answer your question, please click on “Accept as Solution” to help other members find it more quickly. If you thought this post was helpful, please give it a Thumbs Up.
hxiaSMMA
Level: Powered On

Re: Convert Datetime using "convert time zone" action

Hi Rich,

 

Where do I add that? Sorry I am new to Flow...Flowchart.PNG

Do I need a new action between "Convert time zone" and "Filter Array 3"?

 

Best

 

Dual Super User
Dual Super User

Re: Convert Datetime using "convert time zone" action

@hxiaSMMA 

 

Depends on where you want it

 

In apply to each (last action) if you need it in that loop

 

then use

 

replace(item()?['internal name of field'],'000Z','')

hxiaSMMA
Level: Powered On

Re: Convert Datetime using "convert time zone" action

I want to use the shorted datetime here:

Capture.PNG

Dual Super User
Dual Super User

Re: Convert Datetime using "convert time zone" action

@hxiaSMMA 

 

Then add the expression there

 

click on the box - go to expression panel and enter it there

 

replace(dynamiccontentreference,'000Z','')

hxiaSMMA
Level: Powered On

Re: Convert Datetime using "convert time zone" action

It says expression is invalid. 

I am sorry about this...I am not too familiar with Flow...

Dual Super User
Dual Super User

Re: Convert Datetime using "convert time zone" action

@hxiaSMMA 

 

Share screenshot of expression

 

hxiaSMMA
Level: Powered On

Re: Convert Datetime using "convert time zone" action

error.PNG

Dual Super User
Dual Super User

Re: Convert Datetime using "convert time zone" action

Hi @hxiaSMMA 

 

dynamiccontentreference - that is a dummy text I added for you to replace it with the field which stores the actual value 

 

so remove this from the expression and then swicth to dynamic content (WHILE IN EXPRESSION WINDOW - dynamic content is right to the left of it as a tab) and select the field which has the date value you want the last 4 chars to be replaced

 

--------------------------------------------------------------------------------
If this post helps answer your question, please click on “Accept as Solution” to help other members find it more quickly. If you thought this post was helpful, please give it a Thumbs Up.

 

View solution in original post

Helpful resources

Announcements
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 Kudoed Authors (Last 30 Days)
Users online (4,718)