Smart APIs support the concept of hierarchical select lists, meaning that the value selected for one property determines what values are available for another property that is bound to a different (but related) select list.
The SampleService Smart API demonstrates this concept. There are two select lists implemented:
-
Insulation Purpose (InsulPurpose)
-
Insulation Spec (InsulSpec)
Insulation Purpose contains two items, as shown directly above:
-
C
-
H
Insulation Spec is related to Insulation Purpose. In this case, Insulation Purpose is the Parent for the Insulation Spec list. You can query SelectLists for Parent and/or Descendant to discover hierarchical relationships for select lists:
GET https://sam.spclouddave.com/SampleService/Sppid/V2/SelectLists?$expand=Parent,Descendant
{
"ConcurrencyToken": "5247733223689787914",
"Id": "InsulPurpose",
"Name": "Insulation Purpose",
"HierarchyName": "Insulation",
"Parent": null,
"Descendant": {
"ConcurrencyToken": "5247733223689787914",
"Id": "InsulSpec",
"Name": "Insulation Spec",
"HierarchyName": "Insulation"
}
},
{
"ConcurrencyToken": "5247733223689787914",
"Id": "InsulSpec",
"Name": "Insulation Spec",
"HierarchyName": "Insulation",
"Parent": {
"ConcurrencyToken": "5247733223689787914",
"Id": "InsulPurpose",
"Name": "Insulation Purpose",
"HierarchyName": "Insulation"
},
"Descendant": null
}
Each item from the descendant select list is related to an item from its parent select list.