Set Category based on user input (Record Producer Form)

Dimitrios Hatzi
Tera Contributor

Hello community.

 

I have a record producer user input form that ask for several inputs.

 

One particular drop down, has 5 options to pick from.

 

Based on the option they pick from that drop down list, I want the category to be set.

 

Example:

if (producer.type_of_assistance.getDisplayValue() == 'Data Query') {
    current.category = 'Adhoc Query';
}

This works - partially. When the record gets produced, I would expect it to match to the already pre-existing Adhoc Query category. 

 

Instead, I get the category to Adhoc Query but when I expand the category list, the Adhoc Query is listed at the bottom and in blue characters. I suspect because the Adhoc Query as a category belongs under multiple Incident Types, it does not know how to reference it.

 

Any help, will be greatly appreciated.

 

Thanks!

2 REPLIES 2

Voona Rohila
Kilo Patron
Kilo Patron

Hi @Dimitrios Hatzi 

Use Category 'Adhoc Query' choice  backend value instead of the label.


Mark it helpful if this helps you to understand. Accept solution if this give you the answer you're looking for
Kind Regards,
Rohila V
2022-25 ServiceNow Community MVP

If the Choice value is not present then it appears as blue, You have to use proper backend value of 'Adhoc Query' 

For ex - If I want to map '2- High' then I will use '2' while mapping, If I give 5 then the value will be shown in blue(As we don't have any choices with value 5)

VoonaRohila_0-1728326316731.png

 


Mark it helpful if this helps you to understand. Accept solution if this give you the answer you're looking for
Kind Regards,
Rohila V
2022-25 ServiceNow Community MVP