My UiPath robot reads emails that are marked with a category (‘DIST_DATA’) and after extracting the attachment, removes this category and changes the category to ‘Processed’. This part is working well.
The issue is, at times, the email could have more than 1 category assigned to it such as ‘DIST_DATA’, ‘NEW Supplier’ or ‘DIST_DATA’, ‘URGENT’
In this case, how can I set the properties in ‘Set Outlook Mail Categories’ such that only the ‘DIST_DATA’ category is removed and the additional category is not removed?
The additional category could be any string and I want to make sure that only the ‘DIST_DATA’ category is removed from a processed email and additional categories are left untouched.
What I have:
What I am achieving now:
What I would like to achieve:
Any recommendations on how I can achieve this?
You need to preserve the existing categories by using
Doing these steps as above will make sure all the additional categories are retained and only the dist data is updated
After doing either of the above processing based on the return type of GetCategories method just pass it to the
Categories prop of
Set Outlook Mail Category
Hope this helps
Your recommendation worked.
For future reference, I just want to point out how I worked on it based on your idea.
Get categories of mail:
—> this_var = mail.GetCategories.ToArray()
Replace string in Array:
—> this_var = this_var.Select(Function(x) x.Replace(“DIST_DATA”,“Processed”)).ToArray()
Then use this variable “this_var” for ‘Categories’ in the Set Outlook Mail Categories activity.
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.