cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Alphadrag
Helper IV
Helper IV

checking date

Hi, how can i write my power automate flow to check for certain characters in the data and remove it. So for example, i got afew data here in different cells, but belonging under the same column.

 

1st cell: 22nd May 2022

2nd cell: 3rd May 2022

3rd cell: 4th May 2022

4th cell: 1st May 2022

 

How can i remove away the 'nd', 'rd', and 'th'?

1 ACCEPTED SOLUTION

Accepted Solutions
VJR
Super User
Super User

If you are able to get a regular expression then great else below is a simple way using the in-built PAD actions.

 

Only st, nd, rd, st, th will be present for dates from 1st to 31st. Replace these with blank string.
For st, take care of dates like 1st August where st is used twice but st comes only for 1st, 21st, 31st, so replace 1st with 1.

 

Write a common Subflow that will perform the above actions so you can call it again and again like a function.

 

 

VJR_0-1652262935161.png

 

 

Post back if you are facing any issues.

 

View solution in original post

5 REPLIES 5
VJR
Super User
Super User

If you are able to get a regular expression then great else below is a simple way using the in-built PAD actions.

 

Only st, nd, rd, st, th will be present for dates from 1st to 31st. Replace these with blank string.
For st, take care of dates like 1st August where st is used twice but st comes only for 1st, 21st, 31st, so replace 1st with 1.

 

Write a common Subflow that will perform the above actions so you can call it again and again like a function.

 

 

VJR_0-1652262935161.png

 

 

Post back if you are facing any issues.

 

The format for the date is dd MMM yyyy

ApoxiomeN
Frequent Visitor

ApoxiomeN_1-1652266094222.png

 

 

Hi, can explain this regular expression please thank you

You pass for example "22nd May 2022" and in this case it selects "nd".

It always selects the letters behind the day, before the space and the capital letter of the month.

You just replace it with nothing (%""%), effectively deleting those letters and you end up with the format you're looking for.

 

(?<=[0-9])([a-z].*)(?=\s[A-Z])

so you can paste it

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 (1,757)