2018.1

Table Of Contents
Examples
Basic 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
Repository Object" on page123).
JavaScript
repoObject.GetKeySets("Users", '["FirstName","LastName"]',
"Gender='M'");
VB Script
myKeySet = repoObject.GetKeySets("Users", "
[""FirstName"",""LastName""]", "Gender='M'")
Querying a single row
This JavaScript example shows how to get one or more rows from the repository and use them
in the process. The script gets 3 fields ("firstname", "lastname" and "email") from the
CustomerID field. It assumes there's a local variable called %{CustomerID} set in the workflow
process.
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 replacing the last option from GetKeySets (the filter on CustomerID) with an asterisk, 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"}]'
Page 133