JSON Object
Description
An JSON object. This object is not a built-in utility object, but can be accessed using one of the following methods:
Method
GetArray | Retrieves the values of a JSON array. |
GetObject | Retrieves a JSON object. |
GetValue | Retrieves the property value of a JSON object. |
GetArray Method
Description
Retrieves the values of a JSON array.
Syntax
[JSONObject].GetArray(ArrayName)
Argument | Type | Description |
---|---|---|
ArrayName | String | Indicates the name of a JSON array. |
The following example uses the GetArray Method to retrieve the values in a JSON array called "IDs".
Set Dom = JsonUtil.Parse("{
"Image":{
"IDs": [116, 943, 234]
}
}")
For Each i In Dom.GetObject("Image").GetArray("IDs")
Print i
Next
GetObject Method
Description
Retrieves a JSON object.
Syntax
[Dom].GetObject(JSONObject)
Argument | Type | Description |
---|---|---|
JSONObject | String | A JSON object. |
The following example uses the GetObject Method to retrieve a JSON object.
Set Dom = JsonUtil.Parse("{
"Image":{
"IDs": [116, 943, 234]
}
}")
Set obj = Dom.GetObject("Image")
Print obj
GetValue Method
Description
Retrieves the property value of a JSON object.
Syntax
[JSONObject].GetValue(PropertyName)
Argument | Type | Description |
---|---|---|
PropertyName | String | The name of a property. |
The following example uses the GetValue Method to retrieve the value of a property of a JSON object.
Set Dom = JsonUtil.Parse("{
"Image":{
"Width": 800
}
}")
Print Dom.GetObject("Image").GetValue("Width")
See also:
- Crypt Object
- DataTable Object
- Description Object
- DeviceReplay Object
- DotNetFactory Object
- DTParameter Object
- DTSheet Object
- Environment Object
- Extern Object
- Parameter Object
- JSON Object
- JsonUtil Object
- MercuryTimers Object (Collection)
- MercuryTimer Object
- NV Object
- OptionalStep Object
- ParallelUtil Object
- LocalParameter Object
- PasswordUtil Object
- PathFinder Object
- PDFUtil Object
- Properties Object (Collection)
- QCUtil Object
- RandomNumber Object
- Recovery Object
- Remote Connection Object
- Reporter Object
- RepositoriesCollection Object
- Repository Object
- Services Object
- Setting Object
- SystemMonitor Object
- TestArgs Object
- TextUtil Object
- UIAutomation Object
- VisualRelation Object
- VisualRelations Object
- VisualRelationsCollection Object
- WebUtil Object
- XMLUtil Object