<?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 Re: How to create record based on some filed in Record producer in ITSM forum</title>
    <link>https://www.servicenow.com/community/itsm-forum/how-to-create-record-based-on-some-filed-in-record-producer/m-p/3278345#M541388</link>
    <description>&lt;P&gt;Thank you&amp;nbsp;&lt;a href="https://www.servicenow.com/community/user/viewprofilepage/user-id/472041"&gt;@abbasshaik4&lt;/a&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Sun, 01 Jun 2025 14:33:43 GMT</pubDate>
    <dc:creator>neehas</dc:creator>
    <dc:date>2025-06-01T14:33:43Z</dc:date>
    <item>
      <title>How to create record based on some filed in Record producer</title>
      <link>https://www.servicenow.com/community/itsm-forum/how-to-create-record-based-on-some-filed-in-record-producer/m-p/3276580#M541231</link>
      <description>&lt;P&gt;Suppose there is a field on a record produces type. If type is "Incident", an Incident should be created. If type is "Problem", then a Problem should be created. How will you achieve this?&lt;/P&gt;</description>
      <pubDate>Thu, 29 May 2025 11:03:24 GMT</pubDate>
      <guid>https://www.servicenow.com/community/itsm-forum/how-to-create-record-based-on-some-filed-in-record-producer/m-p/3276580#M541231</guid>
      <dc:creator>neehas</dc:creator>
      <dc:date>2025-05-29T11:03:24Z</dc:date>
    </item>
    <item>
      <title>Re: How to create record based on some filed in Record producer</title>
      <link>https://www.servicenow.com/community/itsm-forum/how-to-create-record-based-on-some-filed-in-record-producer/m-p/3278251#M541385</link>
      <description>&lt;P&gt;Hello&amp;nbsp;&lt;a href="https://www.servicenow.com/community/user/viewprofilepage/user-id/790565"&gt;@neehas&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;DIV class="WaaZC"&gt;
&lt;DIV class="RJPOee EIJn2"&gt;
&lt;DIV class="rPeykc" data-hveid="CAIQAQ" data-ved="2ahUKEwiyiqeRy8-NAxWtS3ADHdDjEF0Qo_EKegQIAhAB"&gt;&lt;SPAN data-huuid="10460955867428970761"&gt;To create a record in ServiceNow based on a field within a Record Producer, you'll need to&amp;nbsp;&lt;MARK class="QVRyCf"&gt;use scripting to conditionally populate the record's fields based on the value of that specific field&lt;/MARK&gt;.&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN data-huuid="10460955867428970746"&gt;Specifically, you'll use the&amp;nbsp;&lt;CODE class="mv6bHd"&gt;current&lt;/CODE&gt;&amp;nbsp;and&amp;nbsp;&lt;CODE class="mv6bHd"&gt;producer&lt;/CODE&gt;&amp;nbsp;objects within a script to access and modify the new record being created.&lt;SPAN class="pjBG2e" data-cid="d0860931-753b-408f-9fcd-38fe48391e9c"&gt;&lt;SPAN class="UV3uM"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;
&lt;DIV class="NPrrbc" data-cid="d0860931-753b-408f-9fcd-38fe48391e9c" data-uuids="10460955867428970761,10460955867428970746"&gt;
&lt;DIV class="BMebGe btku5b fCrZyc LwdV0e FR7ZSc OJeuxf" tabindex="0" role="button" aria-label="View related links" data-hveid="CAQQAQ" data-ved="2ahUKEwiyiqeRy8-NAxWtS3ADHdDjEF0Q3fYKegQIBBAB"&gt;
&lt;DIV class="niO4u"&gt;
&lt;DIV class="kHtcsd"&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;DIV class="WaaZC"&gt;
&lt;DIV class="RJPOee EIJn2"&gt;
&lt;DIV class="rPeykc uP58nb" data-hveid="CBUQAQ" data-ved="2ahUKEwiyiqeRy8-NAxWtS3ADHdDjEF0Qo_EKegQIFRAB"&gt;&lt;SPAN data-huuid="6561429580810088145"&gt;&lt;SPAN aria-level="2"&gt;Here's a breakdown of the process:&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;DIV class="WaaZC"&gt;
&lt;DIV class="RJPOee EIJn2"&gt;
&lt;OL data-hveid="CCYQAQ" data-ved="2ahUKEwiyiqeRy8-NAxWtS3ADHdDjEF0QnPYKegQIJhAB"&gt;
&lt;LI class="K3KsMc"&gt;
&lt;DIV class="zMgcWd dSKvsb" data-il=""&gt;
&lt;DIV data-crb-p=""&gt;
&lt;DIV class="xFTqob"&gt;
&lt;DIV class="Gur8Ad"&gt;&lt;SPAN&gt;&lt;STRONG&gt;1.&amp;nbsp;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN data-huuid="6561429580810084632"&gt;&lt;STRONG&gt;Define the Field:&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV class="vM0jzc"&gt;&lt;SPAN data-huuid="6561429580810087557"&gt;Create a field (variable) in your Record Producer that will dictate the type or table of the record to be created.&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN data-huuid="6561429580810086386"&gt;This could be a drop-down, a radio button, or another field that allows the user to select the desired type.&lt;SPAN class="pjBG2e" data-cid="ad8362f1-f342-4bc6-ac22-a7f28fd81095"&gt;&lt;SPAN class="UV3uM"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;
&lt;DIV class="NPrrbc" data-cid="ad8362f1-f342-4bc6-ac22-a7f28fd81095" data-uuids="6561429580810084632,6561429580810087557,6561429580810086386"&gt;
&lt;DIV class="BMebGe btku5b fCrZyc LwdV0e FR7ZSc OJeuxf" tabindex="0" role="button" aria-label="View related links" data-hveid="CBwQAQ" data-ved="2ahUKEwiyiqeRy8-NAxWtS3ADHdDjEF0Q3fYKegQIHBAB"&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/LI&gt;
&lt;LI class="K3KsMc"&gt;
&lt;DIV class="zMgcWd dSKvsb" data-il=""&gt;
&lt;DIV data-crb-p=""&gt;
&lt;DIV class="xFTqob"&gt;
&lt;DIV class="Gur8Ad"&gt;&lt;SPAN&gt;&lt;STRONG&gt;2.&amp;nbsp;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN data-huuid="6561429580810088140"&gt;&lt;STRONG&gt;Add a Script:&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV class="vM0jzc"&gt;&lt;SPAN data-huuid="6561429580810086969"&gt;Go to the "What it will contain" section of your record producer and add a script to the "Script" field.&lt;SPAN class="pjBG2e" data-cid="3aa89761-3551-429e-ad65-839fd659921a"&gt;&lt;SPAN class="UV3uM"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;
&lt;DIV class="NPrrbc" data-cid="3aa89761-3551-429e-ad65-839fd659921a" data-uuids="6561429580810088140,6561429580810086969"&gt;
&lt;DIV class="BMebGe btku5b fCrZyc LwdV0e FR7ZSc OJeuxf" tabindex="0" role="button" aria-label="View related links" data-hveid="CB8QAQ" data-ved="2ahUKEwiyiqeRy8-NAxWtS3ADHdDjEF0Q3fYKegQIHxAB"&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/LI&gt;
&lt;LI class="K3KsMc"&gt;
&lt;DIV class="zMgcWd dSKvsb" data-il=""&gt;
&lt;DIV data-crb-p=""&gt;
&lt;DIV class="xFTqob"&gt;
&lt;DIV class="Gur8Ad"&gt;&lt;SPAN&gt;&lt;STRONG&gt;3.&amp;nbsp;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN data-huuid="6561429580810084627"&gt;&lt;STRONG&gt;Conditional Logic:&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV class="vM0jzc"&gt;&lt;SPAN data-huuid="6561429580810087552"&gt;Within the script, use conditional statements (like&amp;nbsp;&lt;CODE class="mv6bHd"&gt;if/else&lt;/CODE&gt;&amp;nbsp;or&amp;nbsp;&lt;CODE class="mv6bHd"&gt;switch&lt;/CODE&gt;) to check the value of the field you defined in step 1.&lt;SPAN class="pjBG2e" data-cid="81751173-0736-4072-9061-1b97db4fd6fe"&gt;&lt;SPAN class="UV3uM"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;
&lt;DIV class="NPrrbc" data-cid="81751173-0736-4072-9061-1b97db4fd6fe" data-uuids="6561429580810084627,6561429580810087552"&gt;
&lt;DIV class="BMebGe btku5b fCrZyc LwdV0e FR7ZSc OJeuxf" tabindex="0" role="button" aria-label="View related links" data-hveid="CB4QAQ" data-ved="2ahUKEwiyiqeRy8-NAxWtS3ADHdDjEF0Q3fYKegQIHhAB"&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/LI&gt;
&lt;LI class="K3KsMc"&gt;
&lt;DIV class="zMgcWd dSKvsb" data-il=""&gt;
&lt;DIV data-crb-p=""&gt;
&lt;DIV class="xFTqob"&gt;
&lt;DIV class="Gur8Ad"&gt;&lt;SPAN&gt;&lt;STRONG&gt;4.&amp;nbsp;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN data-huuid="6561429580810085210"&gt;&lt;STRONG&gt;Record Creation:&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV class="vM0jzc"&gt;&lt;SPAN data-huuid="6561429580810088135"&gt;Depending on the field's value, use the&amp;nbsp;&lt;CODE class="mv6bHd"&gt;current&lt;/CODE&gt;&amp;nbsp;object to set the appropriate values for the new record's fields.&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN data-huuid="6561429580810086964"&gt;For example, if the field indicates an "Incident," you might set the&amp;nbsp;&lt;CODE class="mv6bHd"&gt;table_name&lt;/CODE&gt;&amp;nbsp;to "incident" and other incident-specific fields.&lt;SPAN class="pjBG2e" data-cid="388fc6d4-6a5d-4ff8-b795-cce7984e1c1b"&gt;&lt;SPAN class="UV3uM"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;
&lt;DIV class="NPrrbc" data-cid="388fc6d4-6a5d-4ff8-b795-cce7984e1c1b" data-uuids="6561429580810085210,6561429580810088135,6561429580810086964"&gt;
&lt;DIV class="BMebGe btku5b fCrZyc LwdV0e FR7ZSc OJeuxf" tabindex="0" role="button" aria-label="View related links" data-hveid="CCIQAQ" data-ved="2ahUKEwiyiqeRy8-NAxWtS3ADHdDjEF0Q3fYKegQIIhAB"&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/LI&gt;
&lt;LI class="K3KsMc"&gt;
&lt;DIV class="zMgcWd dSKvsb" data-il=""&gt;
&lt;DIV data-crb-p=""&gt;
&lt;DIV class="xFTqob"&gt;
&lt;DIV class="Gur8Ad"&gt;&lt;SPAN&gt;&lt;STRONG&gt;5.&amp;nbsp;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN data-huuid="6561429580810084622"&gt;&lt;STRONG&gt;Example:&lt;/STRONG&gt;&lt;/SPAN&gt;
&lt;DIV class="NPrrbc" data-cid="27db8a36-5c76-424e-a076-9b3a38b47db6" data-uuids="6561429580810084622"&gt;
&lt;DIV class="BMebGe btku5b fCrZyc LwdV0e FR7ZSc OJeuxf" tabindex="0" role="button" aria-label="View related links" data-hveid="CAoQAQ" data-ved="2ahUKEwiyiqeRy8-NAxWtS3ADHdDjEF0Q3fYKegQIChAB"&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/LI&gt;
&lt;/OL&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;DIV class="WaaZC"&gt;
&lt;DIV class="RJPOee EIJn2"&gt;
&lt;DIV&gt;
&lt;DIV class="ecCNFc notranslate"&gt;
&lt;DIV class="zYSUYd"&gt;
&lt;DIV class="FS7GEb"&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;DIV class="QQjpRc"&gt;
&lt;DIV class="FS7GEb"&gt;
&lt;PRE&gt;&lt;CODE data-ved="2ahUKEwiyiqeRy8-NAxWtS3ADHdDjEF0QjZIMegQINxAC"&gt;&lt;SPAN class="a7yfkb"&gt;// Check the value of the "Type" field (assuming it's named "type")&lt;/SPAN&gt;&lt;BR aria-hidden="true" /&gt;&lt;SPAN class="VSzkzc"&gt;if&lt;/SPAN&gt;&lt;SPAN&gt; (producer.&lt;/SPAN&gt;&lt;SPAN class="VSzkzc"&gt;type&lt;/SPAN&gt;&lt;SPAN&gt; == &lt;/SPAN&gt;&lt;SPAN class="rQeGvc"&gt;"Incident"&lt;/SPAN&gt;&lt;SPAN&gt;) {&lt;/SPAN&gt;&lt;BR aria-hidden="true" /&gt;&lt;SPAN&gt;    current.table_name = &lt;/SPAN&gt;&lt;SPAN class="rQeGvc"&gt;"incident"&lt;/SPAN&gt;&lt;SPAN&gt;; &lt;/SPAN&gt;&lt;SPAN class="a7yfkb"&gt;// Set the table for the record&lt;/SPAN&gt;&lt;BR aria-hidden="true" /&gt;    &lt;SPAN class="a7yfkb"&gt;// Set other Incident-specific fields as needed&lt;/SPAN&gt;&lt;BR aria-hidden="true" /&gt;&lt;SPAN&gt;    current.short_description = &lt;/SPAN&gt;&lt;SPAN class="rQeGvc"&gt;"Generated Incident"&lt;/SPAN&gt;&lt;SPAN&gt;;&lt;/SPAN&gt;&lt;BR aria-hidden="true" /&gt;&lt;SPAN&gt;    current.caller_id = current.user_id; &lt;/SPAN&gt;&lt;SPAN class="a7yfkb"&gt;// Example: Set caller to current user&lt;/SPAN&gt;&lt;BR aria-hidden="true" /&gt;&lt;SPAN&gt;} &lt;/SPAN&gt;&lt;SPAN class="VSzkzc"&gt;else&lt;/SPAN&gt; &lt;SPAN class="VSzkzc"&gt;if&lt;/SPAN&gt;&lt;SPAN&gt; (producer.&lt;/SPAN&gt;&lt;SPAN class="VSzkzc"&gt;type&lt;/SPAN&gt;&lt;SPAN&gt; == &lt;/SPAN&gt;&lt;SPAN class="rQeGvc"&gt;"Problem"&lt;/SPAN&gt;&lt;SPAN&gt;) {&lt;/SPAN&gt;&lt;BR aria-hidden="true" /&gt;&lt;SPAN&gt;    current.table_name = &lt;/SPAN&gt;&lt;SPAN class="rQeGvc"&gt;"problem"&lt;/SPAN&gt;&lt;SPAN&gt;;&lt;/SPAN&gt;&lt;BR aria-hidden="true" /&gt;    &lt;SPAN class="a7yfkb"&gt;// Set other Problem-specific fields as needed&lt;/SPAN&gt;&lt;BR aria-hidden="true" /&gt;&lt;SPAN&gt;    current.short_description = &lt;/SPAN&gt;&lt;SPAN class="rQeGvc"&gt;"Generated Problem"&lt;/SPAN&gt;&lt;SPAN&gt;;&lt;/SPAN&gt;&lt;BR aria-hidden="true" /&gt;&lt;SPAN&gt;    current.caller_id = current.user_id;&lt;/SPAN&gt;&lt;BR aria-hidden="true" /&gt;&lt;SPAN&gt;}&lt;/SPAN&gt;&lt;BR aria-hidden="true" /&gt;&lt;SPAN&gt;// ... other conditions for different record types&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;DIV class="WaaZC"&gt;
&lt;DIV class="RJPOee EIJn2"&gt;
&lt;OL data-hveid="CD4QAQ" data-ved="2ahUKEwiyiqeRy8-NAxWtS3ADHdDjEF0QnPYKegQIPhAB"&gt;
&lt;LI value="1"&gt;&lt;SPAN data-huuid="17685200173335393262"&gt;&lt;STRONG&gt;Test:&lt;/STRONG&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN data-huuid="17685200173335392365"&gt;Order the record producer from the Service Catalogue to verify that the correct record type is created based on the selected field.&lt;SPAN class="pjBG2e" data-cid="ce2c228b-50c3-476f-838c-c6dd9fb4c8cb"&gt;&lt;SPAN class="UV3uM"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/LI&gt;
&lt;/OL&gt;
&lt;P&gt;&lt;EM&gt;&lt;STRONG&gt;&lt;SPAN class="pjBG2e" data-cid="ce2c228b-50c3-476f-838c-c6dd9fb4c8cb"&gt;&lt;SPAN class="UV3uM"&gt;If this is helpful, please hit the thumbs up button and accept the correct solution by referring to this solution in the future; it will be helpful to them.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;EM&gt;&lt;SPAN class="pjBG2e" data-cid="ce2c228b-50c3-476f-838c-c6dd9fb4c8cb"&gt;&lt;SPAN class="UV3uM"&gt;Thanks &amp;amp; Regards,&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;&lt;EM&gt;&lt;SPAN class="pjBG2e" data-cid="ce2c228b-50c3-476f-838c-c6dd9fb4c8cb"&gt;&lt;SPAN class="UV3uM"&gt;Abbas Shaik&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/EM&gt;&lt;/P&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;</description>
      <pubDate>Sun, 01 Jun 2025 06:27:22 GMT</pubDate>
      <guid>https://www.servicenow.com/community/itsm-forum/how-to-create-record-based-on-some-filed-in-record-producer/m-p/3278251#M541385</guid>
      <dc:creator>abbasshaik4</dc:creator>
      <dc:date>2025-06-01T06:27:22Z</dc:date>
    </item>
    <item>
      <title>Re: How to create record based on some filed in Record producer</title>
      <link>https://www.servicenow.com/community/itsm-forum/how-to-create-record-based-on-some-filed-in-record-producer/m-p/3278345#M541388</link>
      <description>&lt;P&gt;Thank you&amp;nbsp;&lt;a href="https://www.servicenow.com/community/user/viewprofilepage/user-id/472041"&gt;@abbasshaik4&lt;/a&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 01 Jun 2025 14:33:43 GMT</pubDate>
      <guid>https://www.servicenow.com/community/itsm-forum/how-to-create-record-based-on-some-filed-in-record-producer/m-p/3278345#M541388</guid>
      <dc:creator>neehas</dc:creator>
      <dc:date>2025-06-01T14:33:43Z</dc:date>
    </item>
  </channel>
</rss>

