RvSet_RvList

Creates a number of new Result Variables. If any of the Result Variables already exist then their value will be updated.

Syntax

object.RvSet_RvList iLineId, sRvList

Part Description
object VoiceGuide object
iLineId Identification number of the line
sRvList Result Variable List. Can be in "[]{}" format, or XML, or JSON

 

sRvList Formats Supported

[]{} [RV_Name1]{RV_Value1}[RV_Name2]{RV_Value2}... etc.
Multiple Key-Value pairs can be specified using multiple []{} entries.
XML Valid XML data
JSON Valid JSON data

 

Example:

set vg = CreateObject("vgServices.CommandLink")
'sets two Result variables - which will be able to be accessed 'later as $RV[CallersRating] and $RV[CallersPreference]
vg.RvSet_RvList $RV_LINEID, "[MembershipLevel]{Silver}[Balance]{370.45}"
vg.Run_ResultReturn $RV_LINEID, "Success"
set vg = Nothing

Then the following Result Variables will be created:

$RV[MembershipLevel] will hold a value of: "Silver"
$RV[Balance] will hold a value of: "370.45"

 

Example:

If this JSON input is supplied in sRvList parameter:

{
 "name" : "Alice Smith",
 "location" : "245 Main St"
 "roster" :
 [
  {
   "weekday" : "Monday",
   "date" : "2023-05-22",
   "start" : "14:00",
   "end" : "22:00"
  },
  {
   "weekday" : "Tuesday",
   "date" : "2023-05-23",
   "start" : "08:00",
   "end" : "16:00"
  },
  {
   "weekday" : "Wednsday",
   "date" : "2023-05-24",
   "start" : "08:00",
   "end" : "12:00"
  }
 ]
}

Then the following Result Variables will be created:

$RV[name] will hold a value of: "Alice Smith"
$RV[location] will hold a value of: "245 Main St"
$RV[roster_1_weekday] will hold a value of: "Monday"
$RV[roster_1_date] will hold a value of: "2023-05-22"
$RV[roster_1_start] will hold a value of: "14:00"
$RV[roster_1_end] will hold a value of: "22:00"
$RV[roster_2_weekday] will hold a value of: "Tuesday"
$RV[roster_2_date] will hold a value of: "2023-05-23"
$RV[roster_2_start] will hold a value of: "08:00"
$RV[roster_2_end] will hold a value of: "16:00"
$RV[roster_3_weekday] will hold a value of: "Wednsday"
$RV[roster_3_date] will hold a value of: "2023-05-24"
$RV[roster_3_start] will hold a value of: "08:00"
$RV[roster_3_end] will hold a value of: "12:00"

JSON input uses fewer tags to describe data, and thus usually results in shorter $RV names being generated for similar data.
Compare $RVs created from JSON input with $RVs created from XML input below.

 

Example:

If this XML input is supplied in sRvList parameter:

<employee>
 <name>Alice Smith</name>
 <location>245 Main St</location>
 <roster>
  <job>
   <weekday>Monday</weekday>
   <date>2023-05-22</date>
   <start>14:00</start>
   <end>22:00</end>
  </job>
  <job>
   <weekday>Tuesday</weekday>
   <date>2023-05-23</date>
   <start>08:00</start>
   <end>16:00</end>
  </job>
  <job>
   <weekday>Wednsday</weekday>
   <date>2023-05-24</date>
   <start>08:00</start>
   <end>12:00</end>
  </job>
 </roster>
</employee>

Then the following Result Variables will be created:

$RV[employee_name] will hold a value of: "Alice Smith"
$RV[employee_location] will hold a value of: "245 Main St"
$RV[employee_roster_job_1_weekday] will hold a value of: "Monday"
$RV[employee_roster_job_1_date] will hold a value of: "2023-05-22"
$RV[employee_roster_job_1_start] will hold a value of: "14:00"
$RV[employee_roster_job_1_end] will hold a value of: "22:00"
$RV[employee_roster_job_2_weekday] will hold a value of: "Tuesday"
$RV[employee_roster_job_2_date] will hold a value of: "2023-05-23"
$RV[employee_roster_job_2_start] will hold a value of: "08:00"
$RV[employee_roster_job_2_end] will hold a value of: "16:00"
$RV[employee_roster_job_3_weekday] will hold a value of: "Wednsday"
$RV[employee_roster_job_3_date] will hold a value of: "2023-05-24"
$RV[employee_roster_job_3_start] will hold a value of: "08:00"
$RV[employee_roster_job_3_end] will hold a value of: "12:00"

 

Example:

Here is an example VBScript that reads in contents of file and passes the file's contents to the RvSet_RvList function:

set fso = CreateObject("Scripting.FileSystemObject")
set fileHandle = fso.OpenTextFile("c:\mydir\data.json")
sFileContents = fileHandle.ReadAll
set fileHandle = Nothing
set fso = Nothing

set vg = CreateObject("vgServices.CommandLink")
vg.RvSet_RvList $RV_LINEID, sFileContents
vg.Run_ResultReturn $RV_LINEID, "Success"
set vg = Nothing

 

VoiceGuide

© Katalina Technologies Pty. Ltd.