Annotation for each item under the select box

ServiceNow Use6
Tera Guru

Hi,

Is it possible to display an annotation for each value under the dropdown in the select box of catalog item? if not, what is the alternative for me to show some text if I select a particular value? Kindly help.

find_real_file.png

Regards

Suman P.

1 ACCEPTED SOLUTION

Can you post the script you are using? This is along the lines of what I would have expected: 

 

function onChange(control, oldValue, newValue, isLoading) {
   if (isLoading || newValue == '') {
      return;
   }
	
	//just an example where my field is named group_action and my value is add
	if(newValue == 'add') {
		g_form.showFieldMsg('group_action', 'You have choosen add', 'info', false);
	}

   
}

find_real_file.png

I hope this helps!

If this was helpful, or correct, please be kind and mark the answer appropriately.

Michael Jones - Proud member of the GlideFast Consulting Team!

I hope this helps!
Michael D. Jones
Proud member of the GlideFast Consulting Team!

View solution in original post

3 REPLIES 3

Michael Jones -
Giga Sage

You can use an onChange client script and g_form.showFieldMsg().

https://docs.servicenow.com/bundle/rome-application-development/page/script/useful-scripts/reference...

But there isn't a way to do it dynamically; you would have to script each value / message. 

I hope this helps!

If this was helpful, or correct, please be kind and mark the answer appropriately.

Michael Jones - Proud member of the GlideFast Consulting Team!

I hope this helps!
Michael D. Jones
Proud member of the GlideFast Consulting Team!

Hi Michael,

The messages keep on stacking up on the top, how should I avoid it?

find_real_file.png

Regards

Suman P.

Can you post the script you are using? This is along the lines of what I would have expected: 

 

function onChange(control, oldValue, newValue, isLoading) {
   if (isLoading || newValue == '') {
      return;
   }
	
	//just an example where my field is named group_action and my value is add
	if(newValue == 'add') {
		g_form.showFieldMsg('group_action', 'You have choosen add', 'info', false);
	}

   
}

find_real_file.png

I hope this helps!

If this was helpful, or correct, please be kind and mark the answer appropriately.

Michael Jones - Proud member of the GlideFast Consulting Team!

I hope this helps!
Michael D. Jones
Proud member of the GlideFast Consulting Team!