The JSONPackage object provides the ability to merge data in a JSON object or extract data from a JSON object. Merging and extracting can occur at both the client side and the server side. The resulted JSON can be posted from the client to the server via HTTPClient, or retrieved from the server to the client via RESTClient.
The JSON string that can be loaded by the JSONPackage object must be an object (cannot be an array) and the item must be a string, object, or array.
Note
This object cannot be referenced in .NET Web Service and .NET Assembly components, otherwise the component will fail to be deployed.
Note
The data to be merged can be from DataWindow, DataStore, DataWindowChild, or from an existing JSON. Composite, Crosstab, OLE 2.0, and RichText DataWindows are unsupported.
JSONPackage property |
Datatype |
Description |
---|---|---|
Boolean |
A boolean value that specifies whether to ignore the case for key. |
|
ClassDefinition |
PowerObject |
An object of type PowerObject containing information about the class definition of the object or control. |
JSONPackage event |
Occurs |
---|---|
Constructor in PowerScript Reference |
When the object is created. |
Destructor in PowerScript Reference |
When the object is destroyed. |
JSONPackage function |
Datatype returned |
Description |
---|---|---|
ClassName in PowerScript Reference |
String |
Returns the name assigned to the object. |
Clear in PowerScript Reference |
Integer |
Deletes all of the keys. |
ContainsKey in PowerScript Reference |
Boolean |
Checks if the key name exists. |
GetContextService in PowerScript Reference |
Integer |
Creates a reference to a context-specific instance of the specified service. |
GetJSONBlob in PowerScript Reference |
Blob |
Gets the JSON blob data. |
GetJSONString in PowerScript Reference |
String |
Gets the JSON string data. |
GetKey in PowerScript Reference |
String |
Gets the key name. |
GetParent in PowerScript Reference |
PowerObject |
Returns a reference to the name of the parent object. |
GetValue in PowerScript Reference |
String |
Gets the value of the key. |
KeyCount in PowerScript Reference |
Long |
Gets the total number of keys. |
LoadFile in PowerScript Reference |
String |
Loads a JSON file. |
LoadString in PowerScript Reference |
String |
Loads a JSON string. |
PostEvent in PowerScript Reference |
Boolean |
Adds an event to the end of the message queue for the object. |
Remove in PowerScript Reference |
Integer |
Removes a key. |
SaveToFile in PowerScript Reference |
Integer |
Saves the JSON data to the local file. |
SetValue in PowerScript Reference |
Boolean |
Sets the value of the key. |
TriggerEvent in PowerScript Reference |
Integer |
Triggers a specific event in the object and executes the script for the event. |
TypeOf in PowerScript Reference |
Object |
Returns the type of the object. |