Solved Change text with format yyyymmdd into date with format yyyy/mm/dd in Blue Prism

rpaccount

Member
Hi all,

I need to change the file names that i've read in the collection from text into date format.
When i use ToDate([Collection.Date])
The following error appears Unable to convert supplied value to a Date : Text value '20170711' cannot be interpreted as a Date
Thanks all!
 
Last edited:

VJR

Well-Known Member
Hi rpaccount,

The below can be done but be noted that the output will be stored as Text and not Date since Text to Date is not directly available.

1529216475571.png

1529216531624.png

Below is the content of the Calc stage:
Left([Input], 4) & "/" & Mid([Input], 5, 2) & "/" & Right([Input], 2)
 

VJR

Well-Known Member
What is the need of numbers eg 4,5,3 in above expressions??
Hi suraj,

What the parameters represent can be easily identified by opening a Calc stage and then by selecting any of the string functions in the list. On the right hand side you will see the Function Details.
For eg; Mid(Text, Start Point, Length)
There is a one liner description for each of these three parameters.
Refer the third screenshot in post #3 here.
Similarly check for the Left and Right functions.
 

juan.gl

New Member
Hi VJR,
How to convert date captured as TEXT format to DATE format ?
Thank you.

you can use the function ToDate({text}), however you need to seperate on some way the, date text ddmmyyyy is not accepted, also some other kind of combinations dosnt work like "mm-dd-yyyy" it will try to conver it as "dd-mm-yyyy", other way you can do that is to just use the MakeDate function and convert the text to numbers, try them out and GL
 
Top