<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>question Incident Form - Populating field values based on Sub category field in Community Central forum</title>
    <link>https://www.servicenow.com/community/community-central-forum/incident-form-populating-field-values-based-on-sub-category/m-p/3397386#M4974</link>
    <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;We are exploring options to populate field values based on subcategory field on Incident form before submitting the ticket.&lt;/P&gt;&lt;P&gt;Templates will not work in our case.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you.&lt;/P&gt;</description>
    <pubDate>Fri, 03 Oct 2025 19:58:59 GMT</pubDate>
    <dc:creator>MThomas1</dc:creator>
    <dc:date>2025-10-03T19:58:59Z</dc:date>
    <item>
      <title>Incident Form - Populating field values based on Sub category field</title>
      <link>https://www.servicenow.com/community/community-central-forum/incident-form-populating-field-values-based-on-sub-category/m-p/3397386#M4974</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;We are exploring options to populate field values based on subcategory field on Incident form before submitting the ticket.&lt;/P&gt;&lt;P&gt;Templates will not work in our case.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you.&lt;/P&gt;</description>
      <pubDate>Fri, 03 Oct 2025 19:58:59 GMT</pubDate>
      <guid>https://www.servicenow.com/community/community-central-forum/incident-form-populating-field-values-based-on-sub-category/m-p/3397386#M4974</guid>
      <dc:creator>MThomas1</dc:creator>
      <dc:date>2025-10-03T19:58:59Z</dc:date>
    </item>
    <item>
      <title>Re: Incident Form - Populating field values based on Sub category field</title>
      <link>https://www.servicenow.com/community/community-central-forum/incident-form-populating-field-values-based-on-sub-category/m-p/3397390#M4975</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://www.servicenow.com/community/user/viewprofilepage/user-id/349783"&gt;@MThomas1&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;One way to do this without using templates is to drive it from a client script. You can use an onChange client script on the Subcategory field and then set values on the other fields you want.&lt;/P&gt;&lt;P&gt;For example:&lt;/P&gt;&lt;P&gt;function onChange(control, oldValue, newValue, isLoading) {&lt;BR /&gt;if (isLoading || newValue == '') {&lt;BR /&gt;return;&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;// Example logic: set Assignment Group / Category / etc. based on subcategory&lt;BR /&gt;if (newValue == 'network') {&lt;BR /&gt;g_form.setValue('assignment_group', '287ebd7da9fe198100f92cc8d1d2154e'); // Networking group sys_id&lt;BR /&gt;g_form.setValue('category', 'infrastructure');&lt;BR /&gt;}&lt;BR /&gt;else if (newValue == 'hardware') {&lt;BR /&gt;g_form.setValue('assignment_group', '6816f79cc0a8016401c5a33be04be441'); // Hardware group sys_id&lt;BR /&gt;g_form.setValue('category', 'hardware');&lt;BR /&gt;}&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;That way you can pre-populate or adjust fields in real time as soon as the subcategory changes.&lt;/P&gt;</description>
      <pubDate>Fri, 03 Oct 2025 20:06:19 GMT</pubDate>
      <guid>https://www.servicenow.com/community/community-central-forum/incident-form-populating-field-values-based-on-sub-category/m-p/3397390#M4975</guid>
      <dc:creator>aruncr0122</dc:creator>
      <dc:date>2025-10-03T20:06:19Z</dc:date>
    </item>
    <item>
      <title>Re: Incident Form - Populating field values based on Sub category field</title>
      <link>https://www.servicenow.com/community/community-central-forum/incident-form-populating-field-values-based-on-sub-category/m-p/3397425#M4976</link>
      <description>&lt;P&gt;Hello&amp;nbsp;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN class=""&gt;&lt;A class="" href="https://www.servicenow.com/community/user/viewprofilepage/user-id/448076" target="_self"&gt;&lt;SPAN class=""&gt;aruncr0122,&lt;/SPAN&gt;&lt;/A&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN class=""&gt;&lt;SPAN class=""&gt;Thank you for your response.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class=""&gt;&lt;SPAN class=""&gt;we tried client script as below but it is not working. Any idea what we are missing ?&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;function&lt;/SPAN&gt;&lt;SPAN&gt; onChange(control, oldValue, newValue, isLoading, isTemplate) {&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;if&lt;/SPAN&gt;&lt;SPAN&gt; (isLoading || newValue == &lt;/SPAN&gt;&lt;SPAN&gt;''&lt;/SPAN&gt;&lt;SPAN&gt;) {&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;return&lt;/SPAN&gt;&lt;SPAN&gt;;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp;}&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;if&lt;/SPAN&gt;&lt;SPAN&gt; (newValue == &lt;/SPAN&gt;&lt;SPAN&gt;'Testing'&lt;/SPAN&gt;&lt;SPAN&gt;) {&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; g_form.setValue(&lt;/SPAN&gt;&lt;SPAN&gt;'assignment_group'&lt;/SPAN&gt;&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN&gt;'87986d24db15a7c0de5b6572ca961939'&lt;/SPAN&gt;&lt;SPAN&gt;);&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; g_form.setvalue(&lt;/SPAN&gt;&lt;SPAN&gt;'description'&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;/SPAN&gt;&lt;SPAN&gt;'This is a test'&lt;/SPAN&gt;&lt;SPAN&gt;);&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp;}&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;else&lt;/SPAN&gt; &lt;SPAN&gt;if&lt;/SPAN&gt;&lt;SPAN&gt; (newValue == &lt;/SPAN&gt;&lt;SPAN&gt;'Virus incident'&lt;/SPAN&gt;&lt;SPAN&gt;) {&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;g_form.setValue(&lt;/SPAN&gt;&lt;SPAN&gt;'assignment_group'&lt;/SPAN&gt;&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN&gt;'75972d24db15a7c0de5b6572ca9619f1'&lt;/SPAN&gt;&lt;SPAN&gt;); &lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;g_form.setValue(&lt;/SPAN&gt;&lt;SPAN&gt;'description'&lt;/SPAN&gt;&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN&gt;'Hello World'&lt;/SPAN&gt;&lt;SPAN&gt;);&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;} &amp;nbsp;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;}&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Fri, 03 Oct 2025 20:36:59 GMT</pubDate>
      <guid>https://www.servicenow.com/community/community-central-forum/incident-form-populating-field-values-based-on-sub-category/m-p/3397425#M4976</guid>
      <dc:creator>MThomas1</dc:creator>
      <dc:date>2025-10-03T20:36:59Z</dc:date>
    </item>
    <item>
      <title>Re: Incident Form - Populating field values based on Sub category field</title>
      <link>https://www.servicenow.com/community/community-central-forum/incident-form-populating-field-values-based-on-sub-category/m-p/3397441#M4977</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://www.servicenow.com/community/user/viewprofilepage/user-id/349783"&gt;@MThomas1&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I see the issue in your script. There are a couple of small mistakes that are causing it not to work:&lt;/P&gt;&lt;P&gt;1.Case sensitivity in g_form.setValue:&lt;/P&gt;&lt;P&gt;JavaScript is case-sensitive. In your first if block you wrote:&lt;/P&gt;&lt;P&gt;g_form.setvalue('description','This is a test');&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;It should be setValue with a capital V:&lt;/P&gt;&lt;P&gt;g_form.setValue('description','This is a test');&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;2.Other things to check:&lt;/P&gt;&lt;P&gt;Make sure your onChange client script is actually attached to the correct field (the one you’re monitoring).&lt;/P&gt;&lt;P&gt;Ensure the field values you are checking ('Testing' and 'Virus incident') exactly match the choice values (case-sensitive and no extra spaces).&lt;/P&gt;&lt;P&gt;Here’s the corrected script:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;function onChange(control, oldValue, newValue, isLoading, isTemplate) {&lt;BR /&gt;if (isLoading || newValue == '') {&lt;BR /&gt;console.log('Form is loading or value is empty, exiting script.');&lt;BR /&gt;return;&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;console.log('New value detected: ' + newValue); // Logs new value&lt;/P&gt;&lt;P&gt;if (newValue == 'Testing') {&lt;BR /&gt;g_form.setValue('assignment_group', '87986d24db15a7c0de5b6572ca961939');&lt;BR /&gt;g_form.setValue('description','This is a test');&lt;BR /&gt;g_form.addInfoMessage('Assignment group and description set for Testing.');&lt;BR /&gt;console.log('Set values for Testing.');&lt;BR /&gt;}&lt;BR /&gt;else if (newValue == 'Virus incident') {&lt;BR /&gt;g_form.setValue('assignment_group', '75972d24db15a7c0de5b6572ca9619f1');&lt;BR /&gt;g_form.setValue('description', 'Hello World');&lt;BR /&gt;g_form.addInfoMessage('Assignment group and description set for Virus incident.');&lt;BR /&gt;console.log('Set values for Virus incident.');&lt;BR /&gt;}&lt;BR /&gt;else {&lt;BR /&gt;g_form.addInfoMessage('No matching value found.');&lt;BR /&gt;console.log('No matching value for: ' + newValue);&lt;BR /&gt;}&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have added some logs in the script.. which will help you debug the issue.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Fri, 03 Oct 2025 20:54:41 GMT</pubDate>
      <guid>https://www.servicenow.com/community/community-central-forum/incident-form-populating-field-values-based-on-sub-category/m-p/3397441#M4977</guid>
      <dc:creator>aruncr0122</dc:creator>
      <dc:date>2025-10-03T20:54:41Z</dc:date>
    </item>
    <item>
      <title>Re: Incident Form - Populating field values based on Sub category field</title>
      <link>https://www.servicenow.com/community/community-central-forum/incident-form-populating-field-values-based-on-sub-category/m-p/3397562#M4978</link>
      <description>&lt;P&gt;&lt;a href="https://www.servicenow.com/community/user/viewprofilepage/user-id/349783"&gt;@MThomas1&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;!--  StartFragment   --&gt;&lt;/P&gt;&lt;P class=""&gt;&lt;SPAN class=""&gt;You can achieve this using a combination of client scripts and reference qualifiers..... For instance, you can create an onChange client script that listens for changes to the Subcategory field and, based on its value, dynamically sets other fields like Assignment Group, Category, or Short Description. This approach allows you to implement conditional logic tailored to your specific requirements. Additionally, to ensure that the Subcategory field is populated appropriately, you can configure a reference qualifier on the Subcategory field that filters available options based on the selected Category, ensuring that only relevant subcategories are presented to the user.......&lt;/SPAN&gt;&lt;/P&gt;&lt;P class=""&gt;&amp;nbsp;&lt;/P&gt;&lt;P class=""&gt;&lt;SPAN class=""&gt;&lt;SPAN&gt;If you found my response helpful, please mark it as &lt;STRONG&gt;‘Accept as Solution’&lt;/STRONG&gt; and &lt;STRONG&gt;‘Helpful’.&lt;/STRONG&gt; This helps other community members find the right answer more easily and supports the community.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class=""&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;!--  EndFragment   --&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 04 Oct 2025 04:04:56 GMT</pubDate>
      <guid>https://www.servicenow.com/community/community-central-forum/incident-form-populating-field-values-based-on-sub-category/m-p/3397562#M4978</guid>
      <dc:creator>kaushal_snow</dc:creator>
      <dc:date>2025-10-04T04:04:56Z</dc:date>
    </item>
    <item>
      <title>Re: Incident Form - Populating field values based on Sub category field</title>
      <link>https://www.servicenow.com/community/community-central-forum/incident-form-populating-field-values-based-on-sub-category/m-p/3398850#M4985</link>
      <description>&lt;P&gt;&lt;a href="https://www.servicenow.com/community/user/viewprofilepage/user-id/448076"&gt;@aruncr0122&lt;/a&gt;&amp;nbsp;, Thank you for your inputs and sharing the client script.&amp;nbsp;&lt;/P&gt;&lt;P&gt;I will try the client script and update the status.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you.&lt;/P&gt;</description>
      <pubDate>Mon, 06 Oct 2025 14:14:51 GMT</pubDate>
      <guid>https://www.servicenow.com/community/community-central-forum/incident-form-populating-field-values-based-on-sub-category/m-p/3398850#M4985</guid>
      <dc:creator>MThomas1</dc:creator>
      <dc:date>2025-10-06T14:14:51Z</dc:date>
    </item>
    <item>
      <title>Re: Incident Form - Populating field values based on Sub category field</title>
      <link>https://www.servicenow.com/community/community-central-forum/incident-form-populating-field-values-based-on-sub-category/m-p/3398852#M4986</link>
      <description>&lt;P&gt;Thank you for your input.&lt;/P&gt;&lt;P&gt;Yes, Subcategory field value is dependent&amp;nbsp; on Category field.&lt;/P&gt;&lt;P&gt;I will try client script and update the status soon.&lt;/P&gt;&lt;P&gt;Thank you.&lt;/P&gt;</description>
      <pubDate>Mon, 06 Oct 2025 14:16:27 GMT</pubDate>
      <guid>https://www.servicenow.com/community/community-central-forum/incident-form-populating-field-values-based-on-sub-category/m-p/3398852#M4986</guid>
      <dc:creator>MThomas1</dc:creator>
      <dc:date>2025-10-06T14:16:27Z</dc:date>
    </item>
    <item>
      <title>Re: Incident Form - Populating field values based on Sub category field</title>
      <link>https://www.servicenow.com/community/community-central-forum/incident-form-populating-field-values-based-on-sub-category/m-p/3398898#M4989</link>
      <description>&lt;P&gt;It is working now.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Field values&amp;nbsp; was causing the issue. I selected the the field label vs value.&lt;/P&gt;&lt;P&gt;Thank you very much for your support.&lt;/P&gt;</description>
      <pubDate>Mon, 06 Oct 2025 15:02:18 GMT</pubDate>
      <guid>https://www.servicenow.com/community/community-central-forum/incident-form-populating-field-values-based-on-sub-category/m-p/3398898#M4989</guid>
      <dc:creator>MThomas1</dc:creator>
      <dc:date>2025-10-06T15:02:18Z</dc:date>
    </item>
    <item>
      <title>Re: Incident Form - Populating field values based on Sub category field</title>
      <link>https://www.servicenow.com/community/community-central-forum/incident-form-populating-field-values-based-on-sub-category/m-p/3399102#M4996</link>
      <description>&lt;P&gt;Glad to hear it’s working now! &lt;span class="lia-unicode-emoji" title=":smiling_face_with_smiling_eyes:"&gt;😊&lt;/span&gt;&lt;BR /&gt;Thanks for the update and for confirming the solution. Happy to help!&lt;/P&gt;</description>
      <pubDate>Mon, 06 Oct 2025 18:54:11 GMT</pubDate>
      <guid>https://www.servicenow.com/community/community-central-forum/incident-form-populating-field-values-based-on-sub-category/m-p/3399102#M4996</guid>
      <dc:creator>aruncr0122</dc:creator>
      <dc:date>2025-10-06T18:54:11Z</dc:date>
    </item>
  </channel>
</rss>

