I am looking for a mail which will be receiving multiple file formats, but I want to specifically download only the (.xlsx) file. If no (.xlsx) file is found in the attachment it should throw a business exception. I have set the filter type to .xlsx in save attachment but not getting how to add the conditions because, in the first “IF” condition, I am checking with the subject of the mail to download the file.
If the above condition is true that is on then side save the attachment usign save attachments with filter…and then read the attachment and check the rowcount>0 for 3rd codnition
If
String.IsNullOrEmpty(mail.Subject) OrElse mail.Attachments.Count = 0 OrElse
Not mail.Attachments.Any(Function(attachment) attachment.Name.EndsWith(".xlsx"))
Then
Throw New BusinessRuleException("yourmessage")
Else
-> Use Save Attachments acitivity to save the excel
-> Read Range Workbook Output-> dt_datatable
If
dt_datatable.Rows.Count=0
Then
Throw New BusinessRuleException("exceptionMessage")
Else
\\ Do required process
End If
End If
After saving attachments in the then section use read Range Workbook to read the excel and after that use an if condition yourdatatable.Rows.Count=0.
Hello, you there? I just needed a quick help here!!
I am working on automation where I am required to take only 10 digits from the variable, in case someone types and updates the data eg. the IDno is “7276176684shaenjk” so it should take only 10 digits not the other char nor the number except this.
and one more requirment is there is tab where i can enter only the int if we enter string by mistake then it should throw the BE, but here i am tring to add the if activity so the required / filtered data only will get uploaded.
Hello, you there? I just needed a quick help here!!
I am working on automation where I am required to take only 10 digits from the variable, in case someone types and updates the data eg. The “IDno” is “7276176684shaenjk” so it should take only 10 digits, not the other char nor the number except this.
and one more requirement is there is a tab where I can enter only the int if we enter a string by mistake then it should throw the BE, but here I am trying to add the if activity so the required/filtered data only will get uploaded.
Input= "7276176684shaenjk"
Output= System.Text.RegularExpressions.Regex.Match(Input,"\d{10}").Value
If
Output.Length.Equals(10)
Then
\\ Do required process
Else
Throw New BusinessRuleException("exceptionMessage")
End If
Assign the in_transactionitem.specific.content(“IDno”).tostring to a variable and pass that variable in the output syntax.
Check below:
Input= in_transactionitem.specific.content("IDno").tostring
Output= System.Text.RegularExpressions.Regex.Match(Input,"\d{10}").Value
If
Output.Length.Equals(10)
Then
\\ Do required process
Else
Throw New BusinessRuleException("exceptionMessage")
End If