cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
AdamW
Helper II
Helper II

How do I extract numbers from a string and then convert it to a date?

I have a text string named FULL_DATE20200820_FILENAME.pdf 

 

I need to pull the date out of that and then convert it to MM/DD/YYYY.  I tried everything and I just can't get it to work.  Can someone please help?  Much appreciated.

1 ACCEPTED SOLUTION

Accepted Solutions
Mira_Ghaly
Dual Super User II
Dual Super User II

@AdamW 

I was able to achieve what you need by making the below:

Compose 2: Contain the string you want to manipulate.

Compose Expression:  Split by Underscore and get the second part

split(outputs('Compose_2'),'_')[1]
 
Compose 3 Expression: Gets Year
substring(outputs('Compose'),4,4)
 
Compose 4 Expression: Get Month
substring(outputs('Compose'),8,2)
 
Compose 5 Expression: Get Day
substring(outputs('Compose'),10,2)
 
Compose 6 Expression: Forms the Date by concatenation
concat(outputs('Compose_4'),'/',outputs('Compose_5'),'/',outputs('Compose_3'))
 

Mira_Ghaly_0-1598946666953.png

Mira_Ghaly_1-1598946707888.png

 

If this post helps you with your problem, please mark your as Accepted solution.

If you like my response, please give it a Thumbs Up.

MG (Naturally Curious)

 

If this post helps you with your problem, please mark your as Accepted solution.If you like my response, please give it a Thumbs Up.

Blog: here

View solution in original post

2 REPLIES 2
Mira_Ghaly
Dual Super User II
Dual Super User II

@AdamW 

I was able to achieve what you need by making the below:

Compose 2: Contain the string you want to manipulate.

Compose Expression:  Split by Underscore and get the second part

split(outputs('Compose_2'),'_')[1]
 
Compose 3 Expression: Gets Year
substring(outputs('Compose'),4,4)
 
Compose 4 Expression: Get Month
substring(outputs('Compose'),8,2)
 
Compose 5 Expression: Get Day
substring(outputs('Compose'),10,2)
 
Compose 6 Expression: Forms the Date by concatenation
concat(outputs('Compose_4'),'/',outputs('Compose_5'),'/',outputs('Compose_3'))
 

Mira_Ghaly_0-1598946666953.png

Mira_Ghaly_1-1598946707888.png

 

If this post helps you with your problem, please mark your as Accepted solution.

If you like my response, please give it a Thumbs Up.

MG (Naturally Curious)

 

If this post helps you with your problem, please mark your as Accepted solution.If you like my response, please give it a Thumbs Up.

Blog: here

View solution in original post

It worked perfectly! Thank you!!

Helpful resources

Announcements
MBAS Attendee Badge

Claim Your Badge & Digital Swag!

Check out how to claim yours today!

MPA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

secondImage

Are Your Ready?

Test your skills now with the Cloud Skill Challenge.

Top Solution Authors
Users online (73,092)