Use > Service Catalogs > Service Catalog management > Importing user options for an item through Web Services

Importing user options for an item through Web Services

After importing Service Catalog items using web services, any options for that item can also be made available when it is ordered. At the time of import and when the optionList and optionOptions fields are populated in the svcCatalog record, a JavaScript function is called via a svcCatalog extaccess expression that parses these two fields, generates an XML string, and populates the Options field for the catalog item.

These are the two new character fields in the svcCatalog extaccess record that are required to import user options.

  • optionList - provides a placeholder for options.
  • optionOptions - provides a placeholder for sub-options related to the options of select type.

The fields for optionList need to be comma delimited character fields that are listed in the following order. If any field is blank, then you must use a comma (“, ”) as a placeholder for that field.

option type, option id, option label, option attribute, option attribute value

The fields for optionOptions need to be comma delimited character fields in the following order. The option ID must match the option ID used in the optionList field above.

option id, options id, options label

Data examples

The following is an example of cart item options that need to be imported for a record.

"text,comment,Comment"

"text,delivery,Delivery Instructions,multiline,true"

"checkbox,printer,Printer Included"

"select,color,Color,style,combo"

"select,size,Size,style,radio"

The data for optionList uses the following format:

optionList="text,comment,Comment,,,text,delivery,Delivery Instructions,multiline,true,checkbox,printer,Printer Included,,,select,color,Color,style,combo,select,size,Size,style,radio,"

The data for optionOptions or sub-options of the select type have the following format:

optionOptions=“color,green,Green,color,red,Red,color,blue,Blue,color,yellow,Yellow,size,small,Small,size,medium,Medium [+$100.00],size,large,Large [+$200.00],”

Results in the Options field

The following is the XML string that populates the Options field in the svcCatalog record.

<form>
 <text id="comment" label="Comment"/>
 <text id="delivery" label="Delivery Instructions" multiline="true"/>
 <checkbox id="printer" label="Printer Included"/>
 <select id="color" label="Color" style="combo">
  <option label="Green">green</option>
  <option label="Red">red</option>
  <option label="Blue">blue</option>
  <option label="Yellow">yellow</option>
 </select>
 <select id="size" label="Size" style="radio">
  <option label="Small">small</option>
  <option label="Medium [+$100.00]">medium</option>
  <option label="Large [+$200.00]">large</option>
 </select>
</form>