Hey all, I am trying to design a workflow:
Fetch emails and store in a orchestrator queue (strings, because you can’t store mailmessages in queue)
In a different sequence, retrieve these queue items
make these queue item strings into mail message
sort emails in different folder
This is my workflow to populate the queue:
The transaction items look like this:
And this is my workflow to retrieve them:
Now I want to convert these queue items back to a mailmessage so I can move the emails to different folders. Does anyone know how to convert this? Or should my workflow look completely different?
Thanks.
Hi @Floris_Maat ,
I believe we can’t store the mail message type in queue or convert it to string and retrieve.
This might be an alternate approach:
Hi,
I need to add mail message as queue item but actually I get info that value of mail.message cannot be converted into QueueItem. How to do this? I need to have this as Queue because it needs to be monitored from Orchestrator. So basically I don’t need the complete mail message item. Just a subject of it would be ok. Do You have idea what should I do?
Best Regards
Hi @Floris_Maat
As same as the current logic that you are using, you can implement the architecture something like this:
In the dispatcher process (i.e data to queue), you can just send the mail ID associated with each mail message that you have.
In another process (which is called the performer), you can retrieve each mail ID present in the queue & fetch the mail from the server using mail ID.
Hope this helps,
Best Regards.
Yes it is not possible to store a mail message type in a queue due to the queue only supporting primitive types. But what I am trying to achieve is converting a string to a mail message.
String to mail message is not possible because mail message is a complex datatype.
Anil_G
(Anil Gorthi)
April 3, 2023, 12:33pm
6
@Floris_Maat
Use MailMes.Headers("Message-ID") which would be giving you unique id and this can be used in get outlook mail message filters and can get the required mail message again
Hope this Helps
cheers
Yes I found something about the UID from @arjunshenoy reply. I will try this!
@Floris_Maat
Although it’s not advisable to convert a mail message to a string, if your objective is just to do so, you can use something called StreamReader.
Let’s say you have a string variable named strMailBody:
Using ms As New MemoryStream(Encoding.UTF8.GetBytes(strMailBody))
mail = MailMessage.Load(ms)
End Using
You can refer the following thread for more:
StreamReader is a TextReader, it reads .txt file, so it is dubious to me it should read from a pdf file. Can you try Read Pdf Text activity and Read Pdf with Ocr (you need to install UiPath.Pdf.Activities packages)
Hope this helps,
Best Regards.