Need a multi select variable on catalog item.

HrishabhKumar
Kilo Sage

I have the following requirement for my catalog item.

First requirement:

1) Need to create a variable "abc" with 4 option "1", "2", "3" and "4".

2) User should be able to select more than one value from the option.

 

Second requirement:

Need to add a text on catalog item, saying "xyz" and if user click on that I want to do certail action through script.

How can I do that.

 

3 REPLIES 3

TamoghnaB
Tera Expert

Hi @HrishabhKumar ,

 

To create a variable with multiple selectable options, please follow:

1. List Collector Variable:
 
  • This is the most common and robust method for allowing users to select multiple items from a list.
  • It presents a "slushbucket" interface, with available items on one side and selected items on the other, allowing users to move items between the two lists.
  • To configure a List Collector:
    • Create a variable of type "List Collector".

Specify the "Table Name" from which the options will be populated 

    • Optionally, add a "Reference Qualifier" to filter the available options.
       
2. Checkbox Variables:
 
  • For a smaller, fixed set of choices, individual checkbox variables can be used.
  • Each checkbox represents a distinct option, and users can select multiple checkboxes independently.
  • To implement:
    • Create multiple variables of type "Checkbox".
    • Assign a clear label to each checkbox representing the choice.
       
3. Multi-Row Variable Sets (MRVS):
 
  • While not a single variable for multiple selections, MRVS can be used in conjunction with other variable types to collect multiple sets of related data.
  • For example, you could have a List Collector to select multiple items, and then an MRVS to gather specific details for each selected item in separate rows.
 

 

TamoghnaB
Tera Expert

Hi @HrishabhKumar ,

 

For your second question:

 

 
1. Displaying a Field Message:
function onChange(control, oldValue, newValue, isLoading) {
if (isLoading || newValue === '') {
return;
}

if (newValue === 'your_value') { // Replace 'your_value' with the actual value that triggers the message
g_form.showFieldMsg('variable_name', 'Your message here.', 'info'); // 'variable_name' is the name of the variable, 'info' can be 'error', 'warning', etc.
} else {
g_form.hideFieldMsg('variable_name'); // Hide the message if the condition is no longer met
}
}
 
Displaying an Info Message (at the top of the form):
function onChange(control, oldValue, newValue, isLoading) {
if (isLoading || newValue === '') {
return;
}

if (newValue === 'another_value') { // Replace 'another_value' with the actual value that triggers the message
g_form.addInfoMessage('This is an important info message.');
}
}
 
3. Displaying an Alert (popup):
 
function onChange(control, oldValue, newValue, isLoading) {
if (isLoading || newValue === '') {
return;
}

if (newValue === 'trigger_alert') { // Replace 'trigger_alert' with the actual value that triggers the alert
alert('You have selected a specific option!');
}
}
 

Please mark reply as Helpful/Correct, if applicable. Thanks!


Please consider marking my reply as Helpful and/or Accept Solution, if applicable. Thanks!

 

Thank you!

J Siva
Tera Sage

Hi @HrishabhKumar 
For the first requirement, use checkbox variables. Alternatively, if you have a custom table to store reusable catalog variable options, store the values in that table and use a list collector variable in the form to allow users to select multiple values. If not, create dropdown options in the 'question_choice' table and use a reference qualifier to fetch them in your list collector variable.

For the second requirement, consider using a 'Custom' type variable. Since the objective of the second requirement is unclear, it's difficult to suggest a specific solution.

 

Regards,
Siva