PhenixID

Create Json Object

Version: 1.0

Category: Process

Extended Category: JSON

Action Package: Standard Actions

Description

Creates a JSON object in a session attribute, from values in existing session attributes.

Parameter Description Example
Result Attribute[Mandatory] The attribute to put the JSON object in.jsonObject
Single String Attributes[Optional] Comma separated list of the attributes with single string values to add as properties in the JSON object. Using this, the value will be surrounded by “. Use | to map the session attribute name with a custom property name.sessionAttributeName|customPropertyName
Multi Value String Attributes[Optional] Comma separated list of the attributes with multi string values to add as properties in the JSON object. Using this, the values will be surrounded by “. Use | to map the session attribute name with a custom property name.sessionAttributeName|customPropertyName
Single Attributes[Optional] Comma separated list of the attributes with single non-string values to add as properties in the JSON object. Using this, the value will NOT be surrounded by “. Use | to map the session attribute name with a custom property.sessionAttributeName|customPropertyName
Multi Value Attributes[Optional] Comma separated list of the attributes with multi non-string values to add as properties in the JSON object. Using this, the values will NOT be surrounded by “. Use | to map the session attribute name with a custom property.sessionAttributeName|customPropertyName

Use Cases

Example 1

Session attributes on the session object:

'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'
Parameter Value
Result Attributeperson
Single String Attributesgivenname|Firstname,sn|Lastname
Multi Value String AttributeschildrenNames
Single Attributesmarried|isMarried
Multi Value AttributeschildrenAges

Result in the session attribute ‘person’ after the action has run:

{"Firstname":"Simon","Lastname":"Smith","childrenNames":["Sarah","James"],"married":true,"childrenAges":[5,11]}

Printer friendly, the value is:

{
  "Firstname":"Simon",
  "Lastname":"Smith",
  "childrenNames":["Sarah","James"],
  "married":true,
  "childrenAges":[5,11]
}

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