Encoding and decoding a json object or string is very simple with the provided helper methods.

Encoding

Encoding json starts with one of the Construct Json methods. You can either create an empty json object or pre-populate it with an already existing object.

Make sure, that after you create an object with one of these methods you immediately store it inside a variable. Since the Construct Json method is pure it gets executed every time another method requests its output. This means, if you don't store it inside a variable you're going to get a new json object while discarding the old one.

If you have your json object you can either get or set its fields with the Set Field method. This method takes the json object, a field name and the value of the field as Json Value. This is the same type you got earlier and makes nesting json values a breeze.

Since you usually don't want to construct a new json object each time, there are multiple overloads to make your life easier.

Decoding

Decoding is the reverse of encoding and it functions exactly the same way. Start of by creating an empty json object and then call the Decode Json function, which takes a json object and a json formatted string and returns a boolean value indicating whether the decoding was successful (i.e. the input string was a valid json string).

After that you can access the fields by their names. As with encoding you can either retrieved them as a json object with the Get Field function, or use one of the overloads.