Hello Community ,
First of all , a pleasure to greet you peeps !
Being that said I would need your help with the following.
I am currently drafting an automation that aims to capture a specific file from an email from my Gmail inbox and then , ideally , download it and store it to a specific folder.
So far , while using Gsuite package I´ve been able to configure the scope with no major problems and I can see the auth going thru just fine.
When it comes to reading the messages and downloading the files I am now facing some issues . Here´s what I´ve done so far :
I have my getMail acitivity configured with its parameters which results on an output which I´ve named MAIL (it is a GmailMessage variable )
After my getMail I am including a FOR EACH loop and whitin my FOR EACH body I added the SAVE ATTACHMENT activity.
Inside the latter I´ve specified that for each mail whithin my Mails the attachment is to be saved on a given folder but when it comes to the dubbuging process I get the follow error :
Error de validación Se encontraron errores del compilador al procesar la expresión “mail”.
Un valor de tipo ‘1-matriz dimensional de UiPath.GSuite.Models.GmailMessage’ no se puede convertir en ‘System.Net.Mail.MailMessage’. Main.xaml
A quick translation would be : A type 1-dimmensional matrix from UiPath.GSuite.Models.GmailMessage cannot be converted to a System.Net.Mail.MailMessage
I´ve specified in my FOR EACH TypeArgument that I will be passing a GmailMessage as shown below :
Still I am getting the same error. Any idea on how can I solve this ?
Hello @prasath17 !
Sorry for the daly on this reply .
I tried your solution and worked correctly, now I am facing the challange of renaming files. My idea is to name the file with today´s date. Should I use the move file feature in order to move it and re name inside the same folder ?
I´ve been going thru some articles so far but I can´t find any specific example that fits my current situation.
@prasath17 you are right , my problem is that while trying to it , the system returns :
ERROR Validation Error Compiler error(s) encountered processing expression “email+ email.Subject.Substring(0,3) +”_“+ datetime.now.ToString(“MM-dd-yyyy”)”.
The operator ‘+’ is not defined for the ‘System.Net.Mail.MailMessage’ y ‘String’.types . Sorry for the back and forth you´ve been more than keen
Hi @prasath17 ,
I copied the information using the shared code (your image) the only detail I had to change was : your mail variable on my end is email and in your case the attachment folder was named with capital letter A and on my end I used all lower , never the less I´m still getting an error. Here´s my info
@prasath17 !
New error now , Im getting Save Mail Message: The given path’s format is not supported.
I read something about multiple dots in the file name, is it possible ?
Also , attached , you´ll find the XAML that im using now.