Hello, could anyone help me with something ? I am trying to make a robot that will respond when a email its recieved to a specific folder. The email will be in text format. I want the robot to do different actions based on what type of text its in the mail.
as you see below thats the form the email will be in, but damage can be changed and same with insurance. Want it to perfrom 4 different tasks here. If the insurance field its emtpy then perform a task. If damage its 1 or 4 perfrom two different tasks, if damage its another number than 1 or 4 then send copy that email and send it to a specific adress
Fine @langsem
Kindly follow the below steps that could help you resolve this
–once after storing the mail in a text file use read text activity to read that file, pass the file path as input and get the output with a string variable named outText
–then use a assign activity and mention like this
outTextSplitArray = outText.Split(Environment.NewLine.ToArray())
where outTextSplitArray is a variable of type string array that would give us the text body in array of single lines
–now use a for each loop and pass the above variable as input and change the type argument as string
–inside the for each loop use a if condition and mention like this item.ToString.Contains(“Insurance”) and Not String.IsNullOrEmpty(Split(item.ToString,“:”)(1).ToString)
if this condition gets passed it will go to THEN part of if condition and we can check the field of insurance , whether the field of insurance is not empty and if this gets passed it will go to THEN part of if condition…where you can mention any process or activities you want, if not we can include the process to be carried out in ELSE part of if condition
–so for the next condition we need is Damage, same use another if condition and check like this item.ToString.Contain(“Damage”) and split(item.ToString,“:”)(1).ToString.Equals(1)
if this gets passed it will go to THEN part of if condition where you can mention the process you want and ELSE part with activities if condition did not pass, use a if condition like this to check whether it is value of 4 item.ToString.Contain(“Damage”) and split(item.ToString,“:”)(1).ToString.Equals(4)
–finally use a if condition to check number other than 1 or 4
same like this
**item.ToString.Contain(“Damage”) and not split(item.ToString,“:”)(1).ToString.Equals(4) and not split(item.ToString,“:”)(1).ToString.Equals(1) **
Kindly try this and let know buddy
Cheers @langsem
Thanks for replying unfortently i am stuck on the first step haha. I am trying to save the email in a folder i have followed this tutorial from 5min where he saves the email and structure it in folders UiPath Essentials Training - E-mail Automation 3.3 - YouTube
But the emails wont be saved and the folder where they are supposed to be stored are still empty