Split Email Conversations
Splits existing conversations into an email message.
Command availability: IBM RPA SaaS and IBM RPA on premises
Description
Splits existing conversations into an email message, so that these conversations are organized into a list.
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.
conversationParser --text(String) (List<String>)=value
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 |
---|---|---|---|---|
Text | text |
Required |
Text |
Body of the email message that will be split. Note:The variable containing the body text of the email message is obtained by returning the Email Body parameter of the Read Email (
emailRead )
command. |
Output parameters
Designer mode label | Script mode name | Accepted variable types | Description |
---|---|---|---|
Email Structure | value |
List<Text> |
Returns a list of conversations retrieved from an email message. |
Example
After obtaining the body of the email message using the Read Email (emailRead
) command, from a connection to an email server, the Split Email Conversations command is
used to read and identify the conversations contained in the message, splitting these conversations and assigning them to a list.
defVar --name emailToSplit --type EmailMessage
defVar --name emailConversations --type List --innertype String
defVar --name emailConnection --type EmailConnection
defVar --name emailSubject --type String
defVar --name emailBody --type String
defVar --name htmlBody --type String
imapConnect --mailhost "outlook.office365.com" --mailport 993 --usessl --username "useremail@email.com" --mailusername "useremail@email.com" --mailpassword userpassword --enableLog emailConnection=value
foreach --collection "${emailConnection}" --variable "${emailToSplit}"
emailRead --message ${emailToSplit} emailSubject=subject emailBody=body htmlBody=htmlbody
conversationParser --text "${emailBody}" emailConversations=value
logMessage --message "Email Body: ${emailBody}\r\nObtained conversations after split: ${emailConversations}" --type "Info"
endFor
imapConnect) command.