How to write 20220915 as 2022/09/15
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
15-09-22 02:04 PM
Good day
Can you please help me out as i am new to blue prism.
How can i write this data item value "20201015" as 2020/10/15?. This value i am getting it from a business object as it is by using a read stage. I tried using split text and extract regex values but no difference.
This value "20221015" is read and stored in the data Item as Text.
FomatDate did also not work.
------------------------------
Helaria Shaningwa
RPA Intern
------------------------------
Can you please help me out as i am new to blue prism.
How can i write this data item value "20201015" as 2020/10/15?. This value i am getting it from a business object as it is by using a read stage. I tried using split text and extract regex values but no difference.
This value "20221015" is read and stored in the data Item as Text.
FomatDate did also not work.
------------------------------
Helaria Shaningwa
RPA Intern
------------------------------
5 REPLIES 5
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
15-09-22 03:12 PM
Hi Helaria,
Here's a way of achieving what you want, hopefully it can help you.
So first we need a way to extract the day, month and year from your text data item:
Right([Data1], 2) - We are extracting the day here
Left([Data1], 4) - We are extracting the year
Mid([Data1], 5, 2) - We are extracting the month
Then we need to make it a date:
MakeDate(Right([Data1], 2), Mid([Data1], 5, 2), Left([Data1], 4))
Then lastly we put it all together and format the date (The below expression is what you'll use in your calc stage):
FormatDate(MakeDate(Right([Data1], 2), Mid([Data1], 5, 2), Left([Data1], 4)), "yyyy/MM/dd")
There might be simpler ways of achieving this.
I hope it helps you
Thank you
------------------------------
Shuaib Salie
------------------------------
Here's a way of achieving what you want, hopefully it can help you.
So first we need a way to extract the day, month and year from your text data item:
Right([Data1], 2) - We are extracting the day here
Left([Data1], 4) - We are extracting the year
Mid([Data1], 5, 2) - We are extracting the month
Then we need to make it a date:
MakeDate(Right([Data1], 2), Mid([Data1], 5, 2), Left([Data1], 4))
Then lastly we put it all together and format the date (The below expression is what you'll use in your calc stage):
FormatDate(MakeDate(Right([Data1], 2), Mid([Data1], 5, 2), Left([Data1], 4)), "yyyy/MM/dd")
There might be simpler ways of achieving this.
I hope it helps you
Thank you
------------------------------
Shuaib Salie
------------------------------
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
15-09-22 07:46 PM
Hi @Helaria Shaningwa,
You can

For finding year:

For finding Date:

For finding month, since we know that it will always be after 4th character and its format is MM (2 characters) hence:
For performing final calculation:

Please let me know if it doesn't work for you.
------------------------------
Manpreet Kaur
Manager
Deloitte
------------------------------
You can
For finding year:
For finding Date:
For finding month, since we know that it will always be after 4th character and its format is MM (2 characters) hence:
For performing final calculation:
Please let me know if it doesn't work for you.
------------------------------
Manpreet Kaur
Manager
Deloitte
------------------------------
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
16-09-22 01:52 PM
Hi Manpreet Kaur
It is working perfectly.
Thank you very much.
------------------------------
Helaria Shaningwa
------------------------------
It is working perfectly.
Thank you very much.
------------------------------
Helaria Shaningwa
------------------------------
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
16-09-22 01:53 PM
Hi Shuaib Salie
Issue is resolved, thanks very much for your input.
Much appreciated.
------------------------------
Helaria Shaningwa
------------------------------
Issue is resolved, thanks very much for your input.
Much appreciated.
------------------------------
Helaria Shaningwa
------------------------------
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
16-09-22 03:09 PM
Hi @Helaria Shaningwa,
Glad to hear it worked :)
------------------------------
Manpreet Kaur
Manager
Deloitte
------------------------------
Glad to hear it worked :)
------------------------------
Manpreet Kaur
Manager
Deloitte
------------------------------
