In an earlier post I explained what agents scripts are and how they might be useful, now I’d like to build on that logic and describe how to actually create an agent script.
Agent scripts are useful to prompt the operators presenting options at each stage of the business process for possible answers (actions) to take. For example creating a new case from a contact.
The steps involved in creating an agent script include;
- Create a hosted control for the agent scripts.
- Create the agent script.
- Create the answers and associated actions for the script.
- Associate the script with the correct hosted control.
Sorry, as again I will be using fishing as a basis for my examples. Feel free to use accounts, contacts and such like in your applications!!!
Step One – Create a hosted control for the agent scripts.
This control essentially is the “container” for the scripts. The controls main purpose gives the location the scripts should be displayed in. This could be anywhere (in theory) but scripts are typically displayed in the left panel.
Note that the USD component type is “Agent Scripting” and that the Display Group is “WorkflowPanel”.
The “WorkflowPanel” is actually in the left panel, below the session overview!
Step Two – Create the agent script.
Next you’ll need to create an agent script that will later be associated with a tab. (hosted control) To do this you’ll need to navigate to the agent scripting area of the Unified Service Desk under settings.
|Name||Obviously this names your agent script but think about the name carefully as this is the name that will be presented to the agent.|
|Script Text||This contains the opening text for the script. Notice that you can insert contextual information here. Such as [[contact.fullname]] or whatever attributes make “sense” in your application.|
|Instructions||Below the script text the instructions will appear, the entry of this information works in the same manner as the script text. So again you can add attributes if required.|
Step Three – Create the answers and associated actions for the script.
The next step will be to create the answers and optionally associate actions to those answers. (Note: screen shot shown in step two was actually taken after I’d added some answers!)
Having saved your agent script you can add a number of answers (tasks) that can be completed by the agent. In the example below notice how the showtab field has been populated, this forces that tab to have focus if that answer is selected.
In my example I am creating an answer which lets the operator view “lakes” associated with a fishing location. You could show cases associated with an account etc!
Having created the answer you can associate any suitable action with the script. It is worth noting that the actions are optional! You could have an answer which simply acts as a reminder to the operator to ask a particular question or give a certain piece of information. In my example I added an existing action to show the associated view of lakes.
Step Four – Associate the script with the correct tab (hosted control)
Having created your agent script you will need to add it to a tab to make it “fire” when a particular tab is displayed. In my example when a fishing location is loaded. Typically you might expect the script to be associated with account, contact or case entities!
To do this navigate to the required hosted control and locate the “BrowserContactComplete” event. From hear you will then need to add a new action to load (fire) your agent script.
The action you add will look something like the one below. Notice how the hosted control is “Agent Scripting”, this you created in step one. And that the action is “GotoTask”. Importantly the data value is the name of the script to be associated with tab. (Again : This is the full “English name” visible to the operators.)
I hope this has given you an insight on how to start creating an agent script, in future posts I will build on this concept and show how to create entities from scripts etc.