PhenixID

Update JSON

Version: 1.0.0

Category: Process

Extended Category: JSON

Action Package: Standard Actions

Description

Update JSON.

Supports SESSION and GLOBAL parameters.

ParameterMandatory/OptionalDefaultDescriptionExample
ConfigMandatoryJSON array containing the different JSON modification operations to execute on the session objectssource
Atomic LevelOptionalnoneHow the action should handle failures executing the different operationsobject
Fail AttributeOptionalThe attribute to store the failure messages in. By default it wont write the failure messages to any attribute.failMsg

Config format

JSON array with JSON objects representing the operations to perform on the session objects.
The following operations are available:

  • update
  • delete
  • move
  • append

Operations

JsonTypes: string, number, boolean, object, array

update

Update operation updates or creates a JSON value in a JSON blob.

PropertyMandatory/OptionalDefault valueDescription
operationMandatoryThe type of operation
targetAttributeMandatoryThe attribute containing the JSON blob to update
jsonPointerMandatoryThe JSON Pointer (rfc6901) pointing to what in the JSON blob should be updated
sourceAttributeMandatoryThe attribute containing the value to add to the JSON blob
typeOptionalstringWhat type of JSON value the source value should be treated as
escapeOptionalfalseIf the source values should be escaped and treated as a string instead. Only applicable for type object and array
{
  "operation": "update",
  "targetAttribute": "target",
  "jsonPointer": "/key",
  "sourceAttribute": "source",
  "type": "string",
  "escape": false
}
delete
PropertyMandatory/OptionalDefault valueDescription
operationMandatoryThe type of operation
targetAttributeMandatoryThe attribute containing the JSON blob to delete in
jsonPointerMandatoryThe JSON Pointer (rfc6901) pointing to what in the JSON blob should be deleted
{
  "operation": "delete",
  "targetAttribute": "target",
  "jsonPointer": "/key"
}
move
PropertyMandatory/OptionalDefault valueDescription
operationMandatoryThe type of operation
targetAttributeMandatoryThe attribute containing the JSON blob to update
sourceMandatoryThe JSON Pointer (rfc6901) pointing to what in the JSON blob should be moved
targetMandatoryThe JSON Pointer (rfc6901) pointing to the new location
{
  "operation": "move",
  "targetAttribute": "target",
  "source": "/key",
  "target": "/new-key"
}
append
PropertyMandatory/OptionalDefault valueDescription
operationMandatoryThe type of operation
targetAttributeMandatoryThe attribute containing the JSON blob to append to
jsonPointerMandatoryThe JSON Pointer (rfc6901) pointing to what in the JSON blob should have the value appended to
sourceAttributeMandatoryThe attribute containing the value used to append
typeOptionalstringWhat type of JSON value the source value should be treated as
escapeOptionalfalseIf the source values should be escaped and treated as a string instead. Only applicable for type object and array
{
  "operation": "update",
  "targetAttribute": "target",
  "jsonPointer": "/key",
  "sourceAttribute": "source",
  "type": "string",
  "escape": false
}

Atomic Level

Atomic level is the configuration for how the action should behave if there are operation(s) failing. There are 3 atomic levels: none, object and full.

  • none will always apply all successful operations
  • object will not apply any changes for a session object if there is one or more failed operations
  • full will not apply any change for all session object if there is one or more failed operations on any of the session objects

Use Cases

Example 1:


DISCLAIMER
Information provided in this document is for your information only. PhenixID makes no explicit or implied claims to the validity of this information. Any trademarks referenced in this document are the property of their respective owners.

The origin of this information may be internal or external to PhenixID. PhenixID makes all reasonable efforts to verify this information.

PhenixID - support.phenixid.se