PhenixID

Sort Session Objects Extended

Version: 1.0

Category: Process

Extended Category: Session Object

Action Package: Standard Actions

Description

Sorts the session objects according to a JSON configuration.

Parameter

Description

Example

JSON Configuration

The JSON configuration for how to sort.

{
    "sortRules": [
        {
            "attribute": "department",
            "caseSensitive": true
        },
        {
            "attribute": "salary",
            "reverseOrder": true,
            "isInteger": true
        }
    ]
}

JSON Configuration

In the root object, there must be a field “sortRules” which must contain an array of objects. Each object may contain the following fields:

  • attribute – The name of the session attribute. Must be provided.
  • reverseOrder – if the ordering should be reversed (descending instead of ascending). Default is false (ascending order).
  • isInteger – if the session attribute’s value should be treated as an integer instead of as text when comparing. Default is false (textual comparison).
  • caseSensitive – if the comparison should take letter casing into account or not for text comparisons. Default is false (case insensitive comparison).

Use Cases

Example 1: Sort on department, then on salary

This action will sort all session objects first on the department (alphabetical), then on the salary (from highest to lowest):

{
    "sortRules": [
        {
            "attribute": "department"
        },
        {
            "attribute": "salary",
            "reverseOrder": true,
            "isInteger": true
        }
    ]
}

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