Agents need to capture the temperature of City on Case form based on City selected on City Field. In order to do so, we decide to create a button on the command bar that agents can click on and that will perform the following tasks:
- Read the City and Country information from the form
- Call an Action that –
- Takes the City and Country as parameters
- Use an external web service to get the temperature in the city
- Returns the temperature as output parameters
- Sets the temperature field value on the form
To start things off, let’s start be creating an Action of type process. This action will have 2 input values (City and Country) and 2 output values (Temperature in Fahrenheit and in Celsius).
The steps are really simple. The action needs to a custom workflow activity that will connect to a weather web service and return the temperature in two output values of its own.
Custom Workflow Activity
Here you can see what the custom workflow activity code looks like. It’s very straight forward in that it only has 3 steps:
- Read the city and country inputs
- Initialize the web service client object and make the web service call
- Set the values back in the output fields to be available in the process