Trying to save email in a folder with a specific title on the folder taken frm the subject

Hello I have a function where i want to loop thorugh email( made this to work)
Look into the subject of the email an retreive the VRN number and save it in a folder called attachments, then each folder inside attachment will be assigned with the VRn number as title. The VRN number its different for each email

the mail subject looks like this M3 Booking confirmed VRN: VH91428 Ordernumber: 0000400334.

When i run the function it dont save anything. So dont know why it won work.
Here is my command lines

mail.Subject.Contains(“M3 Booking confirmed VRN:”)

mail.Subject.Split(“:”.ToCharArray)(1).Split(" ".ToCharArray)(0)

“Attachments” + RegNr

Can you try the below expression. I guess the second element contains the VRN number.
The first element would be just Space.
mail.Subject.Split(":".ToCharArray)(1).Split(" ".ToCharArray)(1)

Did not work, the output console just says starts and end. Dont show any data

Let me check quickly.

You are using the expression wrong. You do not need to convert to char array after split.

The following expression is tested and working.

mail.Subject.Split(":")(1).Split(" ")(1)

Tested in VB.NET compiler -

Regards,
Karthik Byggari

to get this number VH91428
Use like this
Split(Split(Mail.Subject.ToString,“:”)(1).ToString.Trim," ")(0).ToString
Hope this would work
Cheers @langsem

1 Like

getting this error if i use that command option strict on does not allow implicit conversions from string to char

It still dont saves the email in the folder :confused:

but the expression worked right…buddy?

Do not know, the issue i am getting its to actually store the email with the VRN number as title on the folder

you must mention like this buddy
“Attachments\”+RegNr

we need this \ then only it will become a path
Cheers @langsem

did that work buddy @langsem

Hm its still empty. I am wondering if it every reads the email at all

1 Like

What was the condition been set buddy @langsem
and kindly check first whether the mails are fetched and the condition set in the flow decision,
if you checked the onlyunreadmessage property we need to make sure that we have still left with some unread mails in our mail inbox
Check with this and let know buddy @langsem
Cheers

the mail folder is not yet changed buddy, as per your previous post i hope…
and remove the account property value as well, and i think the condition and the split that we did looks good rather we are not getting any mails from here and thats the issue
Kindly try and let know @langsem
Cheers

Sorry what do you mean with" as per your previous post"

I tried to remove the account email name, but still same issue :confused:
Also sent a new mail to that folder

1 Like

this one @langsem

change the folder and try to mention the same on how you did it previously that would get the list of mail messages for sure
Cheers @langsem