Task attributes

Survey mappings can check Twilio Flex task attributes as a condition for creating new survey interactions. In addition, mappings can use Twilio attributes to populate survey parameters.

The following excerpt shows a sample of the properties of a Twilio Flex Task object and the associated task variables in Mindful:

Twilio Flex Task objectMindful Feedback task variables

There is a lot of information about the Twilio Flex task shown in the data structure below. Mindful Feedback pulls this object apart and creates task variables that can be assessed in the survey mapping conditions.

{				

     "attributes": {	

      "SDX_CustomerName:" "Alexander"

     "SDX_external_ref": "CA3a6..."

     "SDX_phone_number": "+61404873642"		

     "SDX_respondent_language": "en-US"

    "SDX_survey_sip_token": "7fd830d0-7efd..."				

     "account_sid": "ACbd1..."

     "api_version": "2010-04-01"

     "call_sid": "CA3a65..."				

     "called": "+61731844087"

     "called_city": ""				

     "called_country": "AU"	

     "called_state": "Queensland"

     "called_zip": ""				

    "caller": "+61404873642"	

     "caller_city": ""

   " caller_country": "AU"				

     "caller_state": ""	

     "caller_zip": ""	

     "direction": "inbound"	

    "from": "+61404873642"

     "from_city": ""				

     "from_country": "AU"	

     "from_state": ""	

     "from_zip": ""	

     "sdxSurveyType": "inbound"	

     "sdxVoiceSurvey": "1"

    "to": "+61731844087"				

     "to_city": ""	

     "to_country": "AU"		

     "to_state": "Queensland"	

     "to_zip": ""

    "type": "inbound"				

    },	

     "dateCreated": "2020-07-16T03:34:08.000Z",			

     "dateUpdated": "2020-07-16T03:36:15.000Z",

     "priority": 0,				

     "queueName": "General Enquiries",	

     "queueSid": "WQ8eaa...",

     "reason": null,				

    "sid": "WT1f7d5...",	

     "status": "wrapping",	

    "taskChannelUniqueName": "voice",	

     "taskChannelSid": "TC...",

     "timeout": 86400,				

     "workflowName": "Assign to Anyone",	

     "workflowSid": "WW4d8...",

     "incomingTransferDescriptor": null,				

     "outgoingTransferDescriptor": null,

     "reservationSid": "WR39..."

You will see all of the derived task variables available in the dropdown menu that appears when using a task variable.

The screenshot below shows the available task variables. These correspond either directly to an attribute of the task object (eg: startTime, id, queueSID) or they are derived (eg: agentID, duration).


Screen capture of Twilio Flex Task attributes in Mindful Feedback

Predefined Twilio Flex Task Variables

The following table explains all of the predefined task variables.

NameShort descriptionNotes
idTask SIDThe Twilio task SID
  • This is an important task attribute that is almost always associated with surveys.
  • This is normally assigned to the External Reference (external_ref) survey interaction attribute.
startTimeStart TimeThe time the Twilio task first started (when the customer arrived at the contact center)
endTimeEnd TimeThe time the Twilio task ended (when the customer left the task and the agent marked it as complete)
durationTask Duration in SecondsThe number of seconds between the startTime and endTime.
queueIdInitial Queue SIDThe Twilio Flex queue SID for the first queue the customer went through during the task
queueNameInitial Queue NameThe Twilio Flex queue name for the first queue the customer went through during the task
callerNumberCaller NumberThe telephone number of the caller
firstAgentIDMindful Agent ID of the first agentThe Mindful Feedback Agent ID corresponding to the first agent that handled the task
  • Mindful Feedback can populate this variable as long as a user exists in Mindful Feedback with the same email address as the Twilio Flex email address of the agent that handled the task
firstAgentEmailEmail of first AgentThe Twilio Flex email address of the agent that first handled the conversation
agentIDMindful Agent ID of the last AgentThe Mindful Feedback Agent ID corresponding to the last agent that handled the task.
agentEmailEmail of last AgentThe Twilio Flex email address of the agent that last handled the task
statusStatusThe status of the Twilio Flex task
priorityPriorityThe priority of the Twilio Flex task
workflowNameTwilio Flex Workflow nameThe name of the Twilio Flex workflow that was utilized by the task
workflowIdTwilio Flex Workflow SIDThe Workflow SID for the Twilio Flex workflow that was utilized by this task
channelTwilio Flex ChannelThe name of the Twilio Flex channel utilized by this task
transferredCaller was transferredA flag, that when set to 1, means the task was transferred at least once. This will be 0 if no transfer occurred.
callSidTwilio Flex Call SIDThe call SID for the Twilio Flex call associated with this task
Custom attributes

You are not limited to using the predefined task variables. Any value from the attributes property of a task object can be referenced simply by using the property name. For example:

Text
"attributes": {
     "SDX_CustomerName:" "Alexander"
    "SDX_external_ref": "CA3a6..."
    "SDX_phone_number": "+61404873642"
    "SDX_respondent_language": "en-US"
    "SDX_survey_sip_token": "7fd830d0-7efd..."
            }

To use a custom property, type the property name into the task variable field.

To learn more: