Show the select box variable label instead of the value.

imkhan
Tera Contributor

Hi All,

I just have query, we are using a multirow variable set, and we have a variable, so how do we show the variable label after selecting the choice from the select box instead of the value? We are getting data from a third party to show that is not storing in ServiceNow.

imkhan_0-1739983787556.png

 

22 REPLIES 22

Hi @Ankur Bawiskar ,

 

There are no choices in the variable. We are not storing the variable label and value, just directly showing data that are coming from a 3rd party.

 

Thanks!

@imkhan 

then this issue will always come since you are adding some option which is not present in question_choice table

Why not use Single line text and simply show A&E and E&A values?

If my response helped please mark it correct and close the thread so that it benefits future readers.

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

Hi @Ankur Bawiskar , 

 

The required is to show all the possible choices into selectbox to user will be chose according to the required.

Thanks!

@imkhan 

Please discuss this with your customer as this is not feasible.

You cannot add choices on the fly in select box

You can do this

1) just before adding the option to that select box create a new record into question_choice using GlideRecord and then addOption using g_form

In this way it will be consistent

If my response helped please mark it correct and close the thread so that it benefits future readers.

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

Hi @Ankur Bawiskar ,

 

Thank you! Okay, we would be required to add the data from the 3rd party in the choice table once the form load. What happens in this case if the choice is already available in the select box? I think we can check if it's available or not and then create or update the record in the choice.

It will be approached or something else through a scheduled job. Thank!