8.7

Table Of Contents
repoObject.AddKeySets "Users","
[{""FirstName"":""John"",""LastName"":""Smith""},
{""FirstName"":""Richard"",""LastName"": ""Doe""}]"
Inserting a row
In most cases, you won't need to insert or update a row in a script, as this can be easily done
through the the Push to Repository action task. However, in some cases you might want to
script it for simplicity's sake.
This JavaScript example inserts 2 different rows into the Users group.
var Repo = new ActiveXObject("RepositoryLib.WorkflowRepository");
Repo.AddKeySets("customers", '[{"CustomerID": "CUJS123456",
"FirstName": "John","LastName": "Smith"},
{"CustomerID": "CURD654321", "FirstName": "Richard", "LastName":
"Doe"}]');
Tip: to update a row instead of adding it, use the GetValue() function to get the KeySet ID; then
update each individual value using SetValueByID() (see "GetValue" on page131 and
"SetValueByID" on page139).
Sample return value
The method returns a JSONIntegerArray containing the ID's of all keysets inserted into
GroupName:
'[131,132]'
AddValue
Creates a new KeySet by assigning Value to the key KeyName in Group GroupName. Note
that KeyName must exist in GroupName, otherwise an error is raised. See AddKey() for
information on adding a key to a group. Upon successful completion, the method returns the ID
of the newly created KeySet.
Syntax
AddValue(GroupName: string, KeyName: string, Value: string):
integer64
Page 128