Loading Option Set Hierarchy¶
The Option Set Hierarchy loading can be done using CSV file.
This CSV should include valid Option Set data that already exists in the system.
It's important to note that the loading can be done for a single Option Set Hierarchy at a time.
Loading With The CLI and Local file¶
The contrail CLI encompasses all the necessary functions for effectively generating Option Set Hierarchy JSON from a CSV file. It offers two distinct commands that can be employed to initiate the JSON generation process.
Generate Keys CSV from Values CSV¶
If your OSH CSV file contains the values (e.g. "Knitt Sweaters") rather than keys (e.g. "knitt_sweaters"), you can convert it using the utility command parseOptionSetsHierarchyValuesToKeysLocalFile. The command will generate a version of the OSH based on the option set keys.
The CLI command to run is
contrail types parseOptionSetsHierarchyValuesToKeysLocalFile <File Path>
Generate JSON from Keys CSV¶
To generate JSON using a local file, you must possess a CSV file that includes valid Option Set Hierarchy data with the associated keys.
The CLI command to run is
contrail types parseOptionSetsHierarchyLocalFile <File Path>
Map Option Set Hierachies in System¶
After successfully generating the Option Set Hierarchy JSON from a local CSV file, it's now time to utilize it within the VibeIQ system.
Create Option Set Hierachy using JSON¶
As depicted in the image below, the process involves creating an Option Set Hierarchy from the Admin console.
You can assign any name to it and add Option Set Hierarchy options sequentially, following the headers provided in the CSV file. Once created, you can simply incorporate the generated JSON into it, and you'll have your Option Set Hierarchy ready to go.
Assign Option Set Hierarchy¶
Merely creating an Option Set Hierarchy is not sufficient. You need to additionally assign it to the Item and Plan Placeholder Types.
As illustrated in the image above, simply include the newly created Option Set Hierarchies within the Item and Plan placeholder entities.