cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
ALP1
Super User
Super User

How to remove the time when the value is provided by a json

Hi,

In a flow, i added the actio parse json.

the I use the dynamic filter provided by json to add a date in my sharepoint list.

The output is in this format

 

ALP1_0-1642159352401.png

 

I want to keep the date only. 

For that i add a compose action and i use this expression

 

substring(outputs('Compose'),0,10)

 

It's working for the monteh where the date are in this format DD/MM/YYYY but sometimes the date are in this format DD/M/YYYY and in this case the expression take the comma. Exemple : 14/01/2022, 

 

Could you help me ?

Thanks

 

2 ACCEPTED SOLUTIONS

Accepted Solutions
ekarim2020
Super User
Super User

We can use the split() function, and split the date/time at the comma character. Try the following expression:

 

first(split(outputs('Compose'),','))

 

The split() function returns an array with two items:

Snag_2c20d83.png

We just want the first item. The first() function will return the first item of the array (i.e. item 0).

Snag_2c709f0.png

The following shows the run time output - with date/times of different lengths:

Snag_2b7c232.png

Hope this helps.


Ellis
____________________________________
If I have answered your question, please mark the post as Solved.
If you like my response, please give it a Thumbs Up.

View solution in original post

ALP1
Super User
Super User

Wow. Just brillant. Thank You so wuch. It s working

And your explanations are very clear

View solution in original post

2 REPLIES 2
ekarim2020
Super User
Super User

We can use the split() function, and split the date/time at the comma character. Try the following expression:

 

first(split(outputs('Compose'),','))

 

The split() function returns an array with two items:

Snag_2c20d83.png

We just want the first item. The first() function will return the first item of the array (i.e. item 0).

Snag_2c709f0.png

The following shows the run time output - with date/times of different lengths:

Snag_2b7c232.png

Hope this helps.


Ellis
____________________________________
If I have answered your question, please mark the post as Solved.
If you like my response, please give it a Thumbs Up.

ALP1
Super User
Super User

Wow. Just brillant. Thank You so wuch. It s working

And your explanations are very clear

Helpful resources

Announcements
Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

MPA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

Learn to digitize and optimize business processes and connect all your applications to share data in real time.

Power Automate Designer Feedback_carousel.jpg

Help make Flow Design easier

Are you new to designing flows? What is your biggest struggle with Power Automate Designer? Help us make it more user friendly!

Top Solution Authors
Top Kudoed Authors
Users online (3,715)