Advanced Command Parameters

Overview

Command sub-categories are an advanced feature that must be enabled for the OEM by Xyte. Contact support to enable it for your account.

Sub-category parameters

Overview

Sub-category parameters split a large drop-down into two cascading drop-downs: the End User first picks a primary value, and the platform then renders a secondary drop-down filtered by that selection.

For example, when picking a song to play, the End User first selects a genre from a short drop-down, then picks from a song list filtered to that genre.

The available values are stored per Device, so each Device can advertise its own set of categories and items.

Setup

Setup has two steps:

  1. Define a Command with two parameters.
  2. Populate the Device's details field with the allowed values.

Setup a command

  1. Create a new command (e.g. "select music")

  2. Add the primary parameter:

    1. Required - True

    2. Hidden - False

    3. Field key - e.g. music_genre

    4. Label - e.g. Genre

    5. Field type - Dynamic list (single select)

    6. Path - e.g. details.music_choices

  3. Add the secondary parameter:

    1. Required - True

    2. Hidden - True

    3. Field key - e.g. song

    4. Label - e.g. Song

    5. Field type - string


Full command configuration:


Set device's details

Use the Update Device API to set the details to contain a key where the options are stored, in the following format:

{
  "field_where_options_are_saved": [
    { category_1_data },
    { category_2_data },
    { category_3_data },
		...    
  ]
}
{
  "label": "What user sees in primary drop-down",
  "children": data for secondary
}
{      
	"key": "Secondary parameter Field Key",
  "label": "Secondary parameter label",
   "options": array of string values for secondary drop-down
}

Sample data:

{
  "music_choices": [
    {
      "label": "Pop",
      "children": {
        "key": "song",
        "label": "Song",
        "options": [
          "Wannabe", "2 Become 1", "Spice Up Your Life"
        ]
      }
    },
    {
      "label": "Rock",
      "children": {
        "key": "song",
        "label": "Song",
        "options": [
          "Creep", "Alive", "No Rain"
        ]
      }
    }
  ]
}

Usage

In the Customer Portal, when the End User invokes the Command, they first see the primary drop-down. Selecting a value renders a secondary drop-down populated from that primary's children.

The enqueued Command carries both selections in its parameters field.

Will result in the following data of the command:

{
  "song": "No Rain",
  "genre": "Rock"
}