Hi,
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.
You need to preserve the existing categories by using MailMessage.GetCategories()
If the above GrtCategories respond a string with categories you can just do string replace the DistData with Processed
If it returns an array then please remove DistData from it and add Processed
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