JsonUtils component

Use this component to perform the following tasks:

When you add this component to an automation, Pega Robotic Automation Studio places it on the Global tab of the component tray so other automations in the project can reference it. You can find this component in the Interaction Management section of the Pega Robotic Automation Studio toolbox.

Methods

The JsonUtils component includes the following methods:

Method

Description

Return type

DeserializeObject
(3 parameters)

Deserializes a JSON string into an object of the given type.

There are two input parameters. JsonString is the JSON string you want to deserialize. The typeString string parameter specifies the deserialized object type.

deserializedObject(determined by typeString)

DeserializeObject (3 parameters)

Deserializes a JSON string into an object of the given type.

There are two input parameters.  JsonString is the JSON string you want to deserialize. objectType is a type parameter that allows you to specify the deserialized object type.

deserializedObject(determined by objectType)

GetValueFromJson

Parses a value out of the JSON string you provide along with a key.

There are two input parameters. JsonString specifies the JSON string for which you want to search. JsonKey is the key that contains the value you want to parse.

parsedValue(string)

GetValueFromJsonByKeys
(1 parameter)

This method works with the JSONKeys property. To use this method, you first add keys to the JSONKeys property for the component. The system then adds the GetValueFromJSONbyKeys method to the methods list.

There is one string input parameter.  JsonString specifies the JSON string for which you want to search.

Returns an output parameter for each key that you added to the JSONKeys property. These parameters contain the parsed values for the JSON key that you indicated.

 

SerializeObject
(2 parameters)

Serializes an object into a JSON string.

This method has one object type input parameter that indicates the object that you want to serialize.

The output parameter, jsonString, contains the serialized object's Json.

jsonString(string)

SerializeObject
(3 parameters)

Serializes an object into a JSON string.

This method has one object type input parameter that indicates the object that you want to serialize.

It has two output parameters. JsonString contains the serialized objects Json. typeString contains the serialized object’s type.

JsonString(string)
typeString(string)

SetValueInJSON

(3 parameters)

Sets a value for a JSON key in a JSON string. This method has three string type parameters thst indicate the value, key, and string.

jsonString(string)

 

Related information

Robot Manager REST Client

REST Client


Privacy | Trademarks | Terms of Use | Feedback

Updated: 18 June 2020

© 2016 - 2020 Pegasystems Inc.  Cambridge, MA All rights reserved.

 

OpenSpan data classification label