Remove Email Classification Filters
Removes the email classification filters.
Command availability: IBM RPA SaaS and IBM RPA on premises
Description
Removes the email classification filters previously applied by the Apply Classification Filters command.
Script syntax
IBM RPA's proprietary script language has a syntax similar to other programming languages. The script syntax defines the command's syntax in the script file. You can work with this syntax in IBM RPA Studio's Script mode.
emailRemoveClassificationFilters --connection(EmailConnection)
Dependencies
-
Use the For Each (
forEach) command to get email message instances. Otherwise, the command will only return the first result. -
Use the following commands to connect to an email server:
-
Connect to Exchange Email Server (
exchangeConnect) -
Connect to IMAP Email Server (
imapConnect) -
Connect to Outlook Server (
outlookConnect)
-
Input parameters
The following table displays the list of input parameters available in this command. In the table, you can see the parameter name when working in IBM RPA Studio's Script mode and its Designer mode equivalent label.
| Designer mode label | Script mode name | Required | Accepted variable types | Description |
|---|---|---|---|---|
| Connection | connection |
Required |
Email Connection |
Variable with the collection containing the email messages to remove the classification filter. |
Example
After establishing a connection with the email server, the Remove Email Classification Filters command removes all the classification filters previously applied by the Apply Classification Filters command.
defVar --name currentMessage --type EmailMessage
defVar --name sender --type String
defVar --name emailConnection --type EmailConnection
defVar --name emailSubject --type String
defVar --name emailBody --type String
imapConnect --mailhost "outlook.office365.com" --mailport 993 --usessl--username "useremail@email.com" --mailusername "useremail@email.com" --mailpassword userpassword --enableLogemailConnection=value
// Classify all messages with the specified filters, with Ascending or Descending order of the messages.
emailApplyClassificationFilters --dateordering "Ascending" --fromordering "Ascending" --toordering "Ascending" --subjectordering "Descending" --sizeordering "Ascending" --limit 25 --offset 1 --connection ${emailConnection}
foreach --collection "${emailConnection}" --variable "${currentMessage}"
// Removes the classification filter previously applied to all email messages, covered by the command "foreach".
emailRemoveClassificationFilters --connection ${emailConnection}
emailRead --message ${currentMessage} emailSubject=subject emailBody=body sender=from
endFor
emailDisconnect --connection ${emailConnection}
Note: Use a valid email connection to run this example script.