Main.xaml (13.0 KB)
Hi All, i am fairly new to UiPath and am wondering if UiPath can download excel attachments from Outlook and create folders when the script is run. I have attached my workflow for reference.
I am able to download the attachment and save into a main folder but the Assign activity used to create folders doesn’t seem to work doesn’t seem to work because of this error message below. (Please uncommented out the Assign activity)
The error message encountered as follows: Message: string was not recognised as a valid Datetime.
Could anyone help me out on this? I followed a youtube video from Andres for this example. Thank you and much appreciated.
Kindly show the Assign activity.
Use Create Directory for creating folders.
“/” is not a valid character in the directory.
See the “/” in your Assign for “StrDate”
Update the highlighted “/” to be a “-” or “.” or “_” or another preferred character.
Hopefully this helps,
hi Steve, thank you for your reply, I tried using “-” or leaving it blank and i still get the same error, could it be there’s something wrong with the format i used to parsed in? when i write line it out i see the format is exactly the same as what i have though
Hi Nithin, the assign activity is as follows
With this syntax:
Like this post:
Try below expression.
Did you print or check in debug mode what is
the actual date and time stamp appears it’s uncommented out initially
thanks Steve, the create folder activity doesn’t seem to be working though, still looking at that part
So the date format is clearly different from the format you have defined in the
Kindly change the format in the second argument of
What’s the exception message / where are you stuck?
Plenty of people like
@Nithinkrishna still here to help
the excel attachment gets saved into the same folder as where i specified it to be without creating new folders as specified with the create folder activity
DateTime.ParseExact(item.Headers(“Date”).ToString,“MMddyyyy HH:mm:ss”,System.Globalization.CultureInfo.InvariantCulture).ToString(“ddMMyyyy HHmmss”)
so basically i need to change the part on “MMddyyyy HH:mm:ss” to mirror this format right:
Thu, 16 Jun 2022 10:47:53 +0800
i tried looking up online for the exact date format online that includes:
, DD MM YYY HH:mm:ss <+GMT timing>
and wasn’t able to look for it - or should there be another format for this?
Take a look here for this one:
Suppose If the input is of full format
Strinput = “23/11/2022 02:20:31 +5:30”
Then to get this as Datetime
var_datetime = Datetime.ParseExact(Strinput.ToString, “dd/MM/yyyy hh:mm:ss K”)
My recent post on datatable [All About Datatable- UiPath] (
All about Datatable - UiPath) was received well in forum with great feedbacks and many suggested to provide some tutorial on topics which are discussed often in our forum
In regards to that I would like to share the commonly used expression for DATETIME conversion
Let’s get started one by one
1. Get Current Date in string format
(Output - string type - “dd/MM/yyyy hh:mm:ss”)
**To get only current da…
I am a bit confused
It saves the attachment but in the incorrect folder?
There is a format, Let me try to post it for u in few mins.
it saves the attachment in the main folder as specified here from the variable i created
it does not create new folders as specified in the create folder activity not sure why