Routing an interaction to the same agent

This example script illustrates how you might route a Twitter message to the agent who previously dealt with the sender. The script, along with action cell parameter settings and variable definitions are shown below.

For a direct Twitter message, the sender's origination ID (account) is used to find the transaction date and identity of the agent who last dealt with the sender. For a public message, the sender's conversation ID is used instead.

The Subtract action cell uses the last transaction date to calculate the date denoting whether or not the interaction is recent ('recent' is defined as '60' minutes in the 'lRecentInterctn' variable). The script's second Compare Variables action cell compares this calculated date with the current date. If the last interaction is recent, the contact is routed to the same agent; otherwise he/she is routed to any agent in the Twitter queue.