Hide the question_text of reference variables

flawed_81
Tera Guru

I have created a catalog item to request a license. The user can ask up to 10 licenses and will need to select the users needing the license based on the number requested in the first variable.

I have already created a client script to show the number of user reference fields depending on the number of licenses. These will be mandatory fields.

I only need the mandatory reference fields without showing the question_text, but I can't find a way to do it.

I can't use a multi-row variable set because I need to row to be a certain number and be mandatory.

Any suggestions please?

2 REPLIES 2

pranita-24
Giga Guru

Hi @flawed_81 

I think This will help you to achieve your requirement. 

  1. Create a Variable Set:

    • Instead of adding these user reference fields directly to the catalog item, you can create a variable set specifically for this purpose.
  2. Add User Reference Fields to the Variable Set:

    • Within the variable set, add the user reference fields for selecting users. These fields can be set as mandatory.
  3. Hide Question Text:

    • By default, variable sets have a "Question Text" field for each variable. To hide the question text, you can do the following:
      • In the variable set, select the user reference fields one by one.
      • In the "Options" tab for each user reference field, set the "Display" field to "False." This will hide the question text for those fields while still making them mandatory.
  4. Link Variable Set to Catalog Item:

    • After creating the variable set with the user reference fields, link this variable set to your catalog item.
  5. Update Client Script:

    • Ensure that your client script to dynamically show the number of user reference fields based on the number of licenses requested is working correctly. You've already done this.

By using a variable set, you can have the desired number of user reference fields, make them mandatory, and hide the question text for a cleaner user experience.

Thank you for your reply.

 

Unfortunately I haven't got the "Options" tab and there is no Display checkbox.

I have a "Hidden" checkbox, but whether I tick it or not the question_text remains visible.

I have removed the "Display" option from the Client script (it was set to true), and left the "setMandatory, true" active. There is no change to what I already had 😞

 

flawed_81_0-1699454564604.png