Viabl.ai Platform Object properties can be accessed directly in JavaScript scripts. With the method's performing special operations on the objects whilst properties effecting the behaviour of Objects. Each type of Viabl Platform Object (List, Numeric, etc) can have its own special properties and methods which can be used to perform various functions. List type Objects can have a further set of properties associated with the List Values (which can be accessed via the inst method)
There are two ways you can access Object properties using JavaScript:
// You can access the property via the Objects properties, for example:
#test.props.description;
// or you can do the below. This is the recommended way of accessing object properties.
#test.prop("description");
The exception is when trying to access some properties such as aName, which can be accessed using the name of the property:
#test.aName;
List of useful properties you can access directly from the Object via Scripts:
Property | Object Type | Description |
---|---|---|
aName | All Objects | The internal name of the value |
nvalues | List Objects | Number of List Values |
props | All Objects | Accessing Object Property values |
aDecPlaces | Numeric Objects | Access the decimal places of the object |
List of useful properties requiring access to the flatprops:
Property | Object Type | Description |
---|---|---|
_default | All Objects | The objects default value |
allowblank | Variable Objects | Allow blank value during dialog capture |
description | Variable Objects | Object description |
extrainfo | Variable Objects | Additional information to show with the 'more' button |
inputmask | Text Objects | This property is used to control the runtime data entry for Text objects. The mask definition uses 'a' to represent an alpha character (A-Z,a-z), '9' to represent a numeric character (0-9), '*' to represent an alphanumeric character (A-Z,a-z,0-9) |
isdynamic | Variable Objects | Determines if full inference on an Object that already has a value, is invoked again to obtain a new value. (true/false) |
isfileupload | Upload Objects | If the object is a file upload |
ispassword | Text Objects | If the text object is a password |
isvisible | Variable Objects | If the object is visible |
knowledgesource | Decision Objects | Used in DMN Export |
maxvalue | Numeric Objects | The maximum required value |
minvalue | Numeric Objects | The minimum required value |
multiline | Text Objects | Dialog capture over multiple-lines |
promptonempty | Decision Objects | Prompts the user at runtime if capture field is empty |
tieddialog | Variable Objects | Name of Dialog Object used to capture value |
units | Numeric Objects | This is used to display the units next to the numeric input control |
If you would like to see the full list of object properties you can access within the Viabl.ai Platform, you can use the control+space key combination for example on the object 'test':
#test.props.<<control+space>>;
These are special functions you can call on objects. For example:
#test.run();
Method | Applicable Object Type | Description |
---|---|---|
addInstance() | List Objects | Add a new List value |
addInstances() | List Objects | Add new List values |
clear() | Variable Objects | Clear Runtime Values |
clearInstances() | List Objects | Delete all existing List values |
delInstance() | List Objects | Delete an existing List value |
encodeInstances() | List Objects | Encodes all instances of the list object |
getType() | All Objects | Retrieve the type of a Viabl Platform Object |
inst() | List Objects | Retrieve List Values Property values |
isEmpty() | Variable Objects | Check if Object has a value |
parentObj() | Variable Objects | Returns the Object's Base Class object |
prop() | All Objects | Accessing Object Property values |
run() | All Objects | Execute Objects |
val() | Variable Objects | Accessing Object values |
value() | Variable Objects | Fill in |