How to dynamically display the choices in my select box field in record producer based from an existing table?

John Clyde Ap_a
Giga Expert

I have this record producer that contains a select boxfind_real_file.png

 

I am trying to display the prices for fields (small, medium, large) when the name of the drink is selected (It is a reference field).

find_real_file.png

Its basically like this but I was only able to implement this in the normal form. I would like to have a similar outcome for it in the record producer. find_real_file.png

How can I achieve this?  Please help.

5 REPLIES 5

Sagar Pagar
Tera Patron

Hi,

You can tried with Select box type variable and mapped it with your target table.

 

Thanks,

Sagar Pagar

The world works with ServiceNow

Hello Sagar,

I have tried to map it but it still won't show up unfortunately. 

There is only one field I can map it to

find_real_file.png

 

but the table I am basing it through has three fields.

find_real_file.png

PriyaRanji
Tera Guru

Hello John,

  • You can define the dependent value along with the choice in sys_choice table and in the respective variable (type : look up select box) of the record producer and define reference qualifier to fetch the choices based on the dependent value.
  • Consider the scenario, choice B is dependent on choice A then define the choice A input as dependent value for choice B and adapt the reference qualifier logic to display the choices dynamically.
  • Choices : small - 50, medium - 100, large - 150 can be created with the dependent value as sys-id of the drink since its the reference field and in the variable "Price per Size" define the type as look up select box and specify look up value field and look up display field along with the reference qualifier specified below:
  • javascript:"^active=true^dependent_value=current.variable.YOURVARIABLE(DRINK)NAME"+"^ORDERBYorder"

Please do let me know in case of any additional inputs needed.

Have a nice day! Stay safe & Healthy 🙂

Thanks,

Priyanka R

Hi PriyaRanji,

I apologize but I need a bit of help

find_real_file.png

What goes to the lookup value field and lookup price field? and does this particular "YOURVARIABLE(DRINK)NAME" refer to the fields (small, medium, large) or the one in the record producer? I am confused as to what it is. Sorry and big thanks!