Assistance Needed – Dropdown Values Not Persisting

Kamva
Giga Guru

Hi Experts,

 

I'm encountering an unusual issue that I'm not familiar with. The values selected in my dropdown (from a recently created catalog item) are not persisting for some reason. I'm unsure why this is happening and would appreciate any assistance in resolving it.

I've attached an image for reference. Any guidance would be greatly appreciated!

 

Thanks in advance.

 

Screenshot 2025-03-07 at 11.30.27.png

4 REPLIES 4

Dr Atul G- LNG
Tera Patron
Tera Patron

Hi @Kamva 

 

Please check if any client script is making it clear or setting it as none. Also, what value is a user adding at the portal level?

*************************************************************************************************************
If my response proves useful, please indicate its helpfulness by selecting " Accept as Solution" and " Helpful." This action benefits both the community and me.

Regards
Dr. Atul G. - Learn N Grow Together
ServiceNow Techno - Functional Trainer
LinkedIn: https://www.linkedin.com/in/dratulgrover
YouTube: https://www.youtube.com/@LearnNGrowTogetherwithAtulG
Topmate: https://topmate.io/atul_grover_lng [ Connect for 1-1 Session]

****************************************************************************************************************

Hi @Dr Atul G- LNG 

 

I don't have any script clearing the field, the values the users selects from are dynamic (returned by Script Include) depending on the user input of the previous inputs

Screenshot 2025-03-09 at 21.23.50.png


Hi @Kieran Anson  need inputs here.

*************************************************************************************************************
If my response proves useful, please indicate its helpfulness by selecting " Accept as Solution" and " Helpful." This action benefits both the community and me.

Regards
Dr. Atul G. - Learn N Grow Together
ServiceNow Techno - Functional Trainer
LinkedIn: https://www.linkedin.com/in/dratulgrover
YouTube: https://www.youtube.com/@LearnNGrowTogetherwithAtulG
Topmate: https://topmate.io/atul_grover_lng [ Connect for 1-1 Session]

****************************************************************************************************************

Because the options are dynamic, the options aren't saved once the item is submitted. You might also have a UI policy modifying the field as the choice value should still be present.

 

If you can avoid the approach, I would. But if not, add something into the isLoading section of your script and check if oldValue != ''. This'll mean you're on a submitted record and you can do a further GlideAjax to fetch the display value of the choice field. 

function onChange(control, oldValue, newValue, isLoading) {
	if(isLoading && oldValue != ''){
		//Do something here to fetch the choice options without clearing the value
	}

   if (isLoading || newValue == '') {
      return;
   }

   g_form.clearOptions('required_support');
   g_form.addOption('required_support' , '', 'No Option'),
   g_form.addOption('required_support' , '1', 'Option 1');
   
}