Syntax

GetWithDefault(name, default)

Description

Use this method to return the property value mentioned by the name parameter from the JSON Object. If no property is found by the given name, then this method will return the value provided in the default parameter.

Parameters

Name Description
name Specifies the name of the property value as a string.
default Specifies the fallback value to return as a string.

Returns

Any.

Example

Local PSM_JSON:Object &oObject = create PSM_JSON:Object();
   
&oObject.AddString("user", "PS");

Local string &sUser = &oObject.GetWithDefault("user", %OperatorId);