PhenixID

Convert JSON to Session Attributes

Version: 1.0

Category: Process

Extended Category: JSON

Action Package: Standard Actions

Description

Convert the first level of properties in a JSON object to session attributes.

Parameter Description Example
Attribute(s) with JSON object[Mandatory] The attribute(s) that contains the JSON object. Multiple attributes can be entered comma separated.jsonObject
Attribute Name Mapping[Optional] To rename one or multiple attributes. Use format JsonProperty1|MyAttributeName1,JsonProperty2|MyAttributeName2. Default, the attributes will remain the name used in the JSON object.givenname|firstname

Use Cases

Example 1

Session attribute ‘person’ on the session object:

{"Firstname":"Simon","Lastname":"Smith","childrenNames":["Sarah","James"],"married":true,"childrenAges":[5,11],"pets":[{"name":"Charlie","animal":"dog"},{"name":"Belle","animal":"cat"}]}

Printer friendly, the value is:

{
  "firstname":"Simon",
  "lastname":"Smith",
  "childrenNames":["Sarah","James"],
  "married":true,
  "childrenAges":[5,11],
  "pets":[
    {
      "name":"Charlie",
      "animal":"dog"
    },
    {
      "name":"Belle",
      "animal":"cat"
    }]
}
Parameter Value
Attribute(s) with JSON objectperson
Attribute Name Mappingfirstname|givenname,lastname|sn

New session attributes after the action has run:

'givenname' with the single value 'Simon'
'sn' with the single value 'Smith'
'married' with the single value 'true'
'childrenNames' with the multi values 'Sarah', 'James'
'childrenAges' with the multi values '5', '11'
'pets' with the multi values 
  '{"name":"Charlie","animal":"dog"}'
  '{"name":"Belle","animal":"cat"}'

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