Previous Topic

Next Topic

Book Contents

Book Index

JSONSetPropertyValue - MaxBasic Function

JSONSetPropertyValue(JSONObject: Object, PropertyName: String, Value: Variant)

Takes a JSON Object and dynamically sets a JSON property value.

JSONSetPropertyValue function has these named arguments:

Parameter

Description

JSON Object

Required. A JSON Object to set a property for.

Property Name

Required. The property name.

Value

The value for the property. Must be a valid JSON type.

Example use:

objJSON = ParseJSON("{}")

objJSON.CustomerName = "Test Name"

objJSON["Description"] = "This is a description added by array notation"

JSONSetPropertyValue(objJSON,"Description2", "This is a description added by function")

BrowseDataSet(objJSON)

Print objJSON["CustomerName"]

Print objJSON["Description"]

Print objJSON["Description2"]