8.7

Table Of Contents
var CustomerID = Watch.GetVariable("CustomerID");
var Repo = new ActiveXObject("RepositoryLib.WorkflowRepository");
var customer = Repo.GetKeySets("customers",'
["firstname","lastname", "customerID"]',"customerID = '" +
CustomerID + "'");
Watch.SetJobInfo(9,customer);
By omitting the last option from GetKeySets (the filter on CustomerID) you can get all the rows
from the data repository.
Return value: JSONStringArray
The method returns a JSONStringArray of key-value pairs, for example:
'[{"FirstName": "John","LastName": "Smith"},{"FirstName":
"Richard", "LastName": "Doe"}]'
The return value (saved for example in the %9 JobInfo variable, as the above example does)
can be used in a number of ways:
l It can be returned to a web page that's making an HTTP request to Workflow. JSON is the
simplest way to transfer information between any system that supports JavaScript.
l It can be passed to Designer and loaded up directly as an object in a script there.
l The JSON can be converted to XML, which makes it useable in the DataMapper module.
This can be easily done in a preprocessor script in the DataMapper (see DataMapper
online help).
GetValue
Performs a lookup in group GroupName and retrieves the first value for key KeyName that
matches Condition. The condition is specified using basic SQL WHERE syntax. The
Condition may be left empty in which case the very first value found for the specified
KeyName is returned.
Syntax
GetValue(GroupName: string, KeyName: string, Condition: string)
Examples
In each of these examples, the object repoObject is deemed having been obtained through a
call to the COM object "RepositoryLib.WorkflowRepository" (see "Obtaining an instance of the
Page 131