<?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: Record is not being created in Decision table with concatenated query in Community Central forum</title>
    <link>https://www.servicenow.com/community/community-central-forum/record-is-not-being-created-in-decision-table-with-concatenated/m-p/3201379#M2431</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://www.servicenow.com/community/user/viewprofilepage/user-id/738399"&gt;@santoshsuta&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;The issue likely arises because the condition field is not being interpreted correctly when dynamically assigned. Here’s what you can try:&amp;nbsp;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp;- Since hardcoded values work, check if dynamically assigned values have any unintended spaces or special characters.&amp;nbsp;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp;- You can explicitly trim the state variable before concatenation:&amp;nbsp;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;/DIV&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;    finalCondition = 'u_incident_state=' + state.trim() + '^u_vtb_kanban_board=02b2d2e6db6fd01041899b3c8a96194e^EQ';​&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp;- Print finalCondition before using it in the questions array to ensure it is correctly formatted:&amp;nbsp;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;A href="http://gs.info" target="_blank" rel="noopener"&gt;gs.info&lt;/A&gt;("Santosh DEBUG: finalCondition string - " + JSON.stringify(finalCondition));&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp;- If the API expects an escaped condition string, try encoding special characters:&amp;nbsp;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/DIV&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt; finalCondition = encodeURIComponent('u_incident_state=' + state + '^u_vtb_kanban_board=02b2d2e6db6fd01041899b3c8a96194e^EQ');​&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp;- Sometimes, JavaScript treats variables differently when assigned dynamically. You can try:&amp;nbsp;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp;&lt;/DIV&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt; var conditionString = String(finalCondition);
     questions = [{ condition: conditionString, answer: [{ value: lane }], active: true, defaultAnswer: false }];​&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;If none of these work, test by hardcoding finalCondition inside questions instead of assigning it dynamically to see if the issue is with data type handling.&lt;BR /&gt;&lt;BR /&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;</description>
    <pubDate>Mon, 10 Mar 2025 12:47:47 GMT</pubDate>
    <dc:creator>RajC59005800307</dc:creator>
    <dc:date>2025-03-10T12:47:47Z</dc:date>
    <item>
      <title>Record is not being created in Decision table with concatenated query</title>
      <link>https://www.servicenow.com/community/community-central-forum/record-is-not-being-created-in-decision-table-with-concatenated/m-p/3201329#M2429</link>
      <description>&lt;P&gt;I am creating a record in Decision Table using catalog item.&amp;nbsp;&amp;nbsp;&lt;BR /&gt;I cannot use Record producer on this&amp;nbsp;&lt;STRONG&gt;sys_decision_question&lt;/STRONG&gt; table due to the security constrains. So, I am using catalog item and creating a record using the flow script.&lt;BR /&gt;Somehow the script is working with the hardcoded values (Please refer below script action)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;-------------------Script Starts from here----------------------------&lt;/P&gt;&lt;P&gt;(function execute(inputs, outputs) {&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; try {&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; gs.info(&lt;SPAN&gt;"Santosh inside"&lt;/SPAN&gt;);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; var state = inputs.state;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; gs.info(&lt;SPAN&gt;"Santosh state: "&lt;/SPAN&gt; + state);&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; var board = inputs.board;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; gs.info(&lt;SPAN&gt;"Santosh Board: "&lt;/SPAN&gt; + board);&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; var decisionTable = inputs.decisionTable;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; gs.info(&lt;SPAN&gt;"Santosh decisionTable: "&lt;/SPAN&gt; + decisionTable);&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; var taskType = (inputs.taskType || &lt;SPAN&gt;""&lt;/SPAN&gt;).trim().toLowerCase();&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; gs.info(&lt;SPAN&gt;"Santosh taskType: "&lt;/SPAN&gt; + taskType);&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; var lane = inputs.lane;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; gs.info(&lt;SPAN&gt;"Santosh lane: "&lt;/SPAN&gt; + lane);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; var finalTasktype = &lt;SPAN&gt;""&lt;/SPAN&gt;;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; var finalCondition = &lt;SPAN&gt;""&lt;/SPAN&gt;;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; if (taskType === &lt;SPAN&gt;"private task"&lt;/SPAN&gt;) {&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; finalTasktype = &lt;SPAN&gt;"vtb_task"&lt;/SPAN&gt;;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; finalCondition = &lt;SPAN&gt;'u_rm_story_state=3^u_vtb_kanban_board=02b2d2e6db6fd01041899b3c8a96194e^EQ'&lt;/SPAN&gt;;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; else if (taskType === &lt;SPAN&gt;"incident"&lt;/SPAN&gt;) {&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; gs.info(&lt;SPAN&gt;"Santosh taskType matched 'incident'"&lt;/SPAN&gt;);&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; finalTasktype = &lt;SPAN&gt;"incident"&lt;/SPAN&gt;;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; finalCondition = &lt;SPAN&gt;'u_incident_state='&lt;/SPAN&gt; + state + &lt;SPAN&gt;'^u_vtb_kanban_board=02b2d2e6db6fd01041899b3c8a96194e^EQ'&lt;/SPAN&gt;;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; else {&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; gs.warn(&lt;SPAN&gt;"Santosh Warning: taskType '"&lt;/SPAN&gt; + taskType + &lt;SPAN&gt;"' does not match any condition."&lt;/SPAN&gt;);&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; if (!finalCondition) {&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; gs.warn(&lt;SPAN&gt;"Santosh Warning: finalCondition is empty for taskType '"&lt;/SPAN&gt; + taskType + &lt;SPAN&gt;"'"&lt;/SPAN&gt;);&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; if (!decisionTable) {&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; gs.error(&lt;SPAN&gt;"Santosh Error: decisionTable sys_id is empty or null!"&lt;/SPAN&gt;);&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; return;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; gs.info(&lt;SPAN&gt;"Santosh finalCondition: "&lt;/SPAN&gt; + finalCondition);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; var questions = [&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; condition: &lt;/STRONG&gt;&lt;SPAN&gt;&lt;STRONG&gt;"u_incident_state=6^u_vtb_kanban_board=02b2d2e6db6fd01041899b3c8a96194e^EQ"&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;STRONG&gt;,&amp;nbsp;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; answer: [&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; { value: lane }&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ],&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; active: true,&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; defaultAnswer: false,&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ];&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; gs.info(&lt;SPAN&gt;"Santosh DEBUG: Questions array prepared - "&lt;/SPAN&gt; + &lt;SPAN&gt;JSON&lt;/SPAN&gt;.stringify(questions));&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; var dt = new sn_dt.&lt;SPAN&gt;DecisionTableAPI&lt;/SPAN&gt;();&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; var response = dt.createQuestions(decisionTable, questions);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; gs.info(&lt;SPAN&gt;"Santosh DEBUG: DecisionTableAPI Response - "&lt;/SPAN&gt; + &lt;SPAN&gt;JSON&lt;/SPAN&gt;.stringify(response));&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; if (response &amp;amp;&amp;amp; response.results &amp;amp;&amp;amp; response.results.length &amp;gt; &lt;SPAN&gt;0&lt;/SPAN&gt; &amp;amp;&amp;amp; response.results[&lt;SPAN&gt;0&lt;/SPAN&gt;].record) {&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; gs.info(&lt;SPAN&gt;'Santosh Status: '&lt;/SPAN&gt; + response.status);&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; gs.info(&lt;SPAN&gt;'Santosh First decision sys_id: '&lt;/SPAN&gt; + response.results[&lt;SPAN&gt;0&lt;/SPAN&gt;].record.getValue(&lt;SPAN&gt;'sys_id'&lt;/SPAN&gt;));&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; } else {&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; gs.warn(&lt;SPAN&gt;'Santosh No valid results found in the API response.'&lt;/SPAN&gt;);&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; } catch (error) {&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; gs.error(&lt;SPAN&gt;"Santosh Exception occurred: "&lt;/SPAN&gt; + error);&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; }&lt;/P&gt;&lt;P&gt;})(inputs, outputs);&lt;/P&gt;&lt;P&gt;-----------------------The script ends here-------------------------------------&lt;/P&gt;&lt;P&gt;The record is being created with the correct Filter conditions and correct Answer value.&lt;BR /&gt;&lt;BR /&gt;BUT&amp;nbsp;&lt;BR /&gt;When I replace the condition hardcoded value with the below mentioned concatenated query. &lt;STRONG&gt;It doesn't works&lt;/STRONG&gt;.&amp;nbsp;&lt;BR /&gt;for example:&lt;BR /&gt;&lt;FONT color="#FF0000"&gt;&lt;STRONG&gt;finalCondition = 'u_incident_state=' + state + '^u_vtb_kanban_board=02b2d2e6db6fd01041899b3c8a96194e^EQ';&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;var questions = [&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; condition: &lt;FONT color="#FF0000"&gt;finalCondition &lt;/FONT&gt;&lt;/STRONG&gt;&lt;STRONG&gt;,&amp;nbsp;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; answer: [&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; { value: lane }&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ],&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; active: true,&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; defaultAnswer: false,&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ];&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;I am getting correct logs mentioned below.&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Santosh finalCondition: u_incident_state=6^u_vtb_kanban_board=02b2d2e6db6fd01041899b3c8a96194e^EQ&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Santosh DEBUG: Questions array prepared - &amp;nbsp;[{"condition":"u_incident_state=6^u_vtb_kanban_board=02b2d2e6db6fd01041899b3c8a96194e^EQ","answer":[{"value":"43a6ae521b0c661092b275de034bcb32"}],"active":true,"defaultAnswer":false}]&lt;BR /&gt;&lt;BR /&gt;This is an additional log says that it's failed to created a record in decision table.&lt;BR /&gt;Santosh DEBUG: DecisionTableAPI Response - {"results":[{"errors":[{"message":"Type mismatch occurred in the field condition when expecting value of type String","type":"INVALID_REQUEST"}],"status":"Failure"}],"errors":[{"message":"1 requests failed","type":"INVALID_REQUEST"}],"status":"Failure"}&lt;BR /&gt;&lt;BR /&gt;Please let me know if anyone have any idea on this.&lt;BR /&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 10 Mar 2025 12:29:42 GMT</pubDate>
      <guid>https://www.servicenow.com/community/community-central-forum/record-is-not-being-created-in-decision-table-with-concatenated/m-p/3201329#M2429</guid>
      <dc:creator>santoshsuta</dc:creator>
      <dc:date>2025-03-10T12:29:42Z</dc:date>
    </item>
    <item>
      <title>Re: Record is not being created in Decision table with concatenated query</title>
      <link>https://www.servicenow.com/community/community-central-forum/record-is-not-being-created-in-decision-table-with-concatenated/m-p/3201379#M2431</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://www.servicenow.com/community/user/viewprofilepage/user-id/738399"&gt;@santoshsuta&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;The issue likely arises because the condition field is not being interpreted correctly when dynamically assigned. Here’s what you can try:&amp;nbsp;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp;- Since hardcoded values work, check if dynamically assigned values have any unintended spaces or special characters.&amp;nbsp;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp;- You can explicitly trim the state variable before concatenation:&amp;nbsp;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;/DIV&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;    finalCondition = 'u_incident_state=' + state.trim() + '^u_vtb_kanban_board=02b2d2e6db6fd01041899b3c8a96194e^EQ';​&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp;- Print finalCondition before using it in the questions array to ensure it is correctly formatted:&amp;nbsp;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;A href="http://gs.info" target="_blank" rel="noopener"&gt;gs.info&lt;/A&gt;("Santosh DEBUG: finalCondition string - " + JSON.stringify(finalCondition));&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp;- If the API expects an escaped condition string, try encoding special characters:&amp;nbsp;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/DIV&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt; finalCondition = encodeURIComponent('u_incident_state=' + state + '^u_vtb_kanban_board=02b2d2e6db6fd01041899b3c8a96194e^EQ');​&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp;- Sometimes, JavaScript treats variables differently when assigned dynamically. You can try:&amp;nbsp;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp;&lt;/DIV&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt; var conditionString = String(finalCondition);
     questions = [{ condition: conditionString, answer: [{ value: lane }], active: true, defaultAnswer: false }];​&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;If none of these work, test by hardcoding finalCondition inside questions instead of assigning it dynamically to see if the issue is with data type handling.&lt;BR /&gt;&lt;BR /&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;</description>
      <pubDate>Mon, 10 Mar 2025 12:47:47 GMT</pubDate>
      <guid>https://www.servicenow.com/community/community-central-forum/record-is-not-being-created-in-decision-table-with-concatenated/m-p/3201379#M2431</guid>
      <dc:creator>RajC59005800307</dc:creator>
      <dc:date>2025-03-10T12:47:47Z</dc:date>
    </item>
    <item>
      <title>Re: Record is not being created in Decision table with concatenated query</title>
      <link>https://www.servicenow.com/community/community-central-forum/record-is-not-being-created-in-decision-table-with-concatenated/m-p/3201392#M2432</link>
      <description>&lt;P&gt;Thank you so much Raj, That worked. &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 10 Mar 2025 12:56:15 GMT</pubDate>
      <guid>https://www.servicenow.com/community/community-central-forum/record-is-not-being-created-in-decision-table-with-concatenated/m-p/3201392#M2432</guid>
      <dc:creator>santoshsuta</dc:creator>
      <dc:date>2025-03-10T12:56:15Z</dc:date>
    </item>
    <item>
      <title>Re: Record is not being created in Decision table with concatenated query</title>
      <link>https://www.servicenow.com/community/community-central-forum/record-is-not-being-created-in-decision-table-with-concatenated/m-p/3201393#M2433</link>
      <description>&lt;P&gt;&lt;a href="https://www.servicenow.com/community/user/viewprofilepage/user-id/738399"&gt;@santoshsuta&lt;/a&gt;&amp;nbsp;If my response helped you in any way consider making it as helpful&amp;nbsp;&lt;BR /&gt;thank you !&lt;/P&gt;</description>
      <pubDate>Mon, 10 Mar 2025 12:57:56 GMT</pubDate>
      <guid>https://www.servicenow.com/community/community-central-forum/record-is-not-being-created-in-decision-table-with-concatenated/m-p/3201393#M2433</guid>
      <dc:creator>RajC59005800307</dc:creator>
      <dc:date>2025-03-10T12:57:56Z</dc:date>
    </item>
    <item>
      <title>Re: Record is not being created in Decision table with concatenated query</title>
      <link>https://www.servicenow.com/community/community-central-forum/record-is-not-being-created-in-decision-table-with-concatenated/m-p/3201396#M2434</link>
      <description>&lt;P&gt;Already accepted a solution and marked as accepted.&lt;/P&gt;</description>
      <pubDate>Mon, 10 Mar 2025 12:59:17 GMT</pubDate>
      <guid>https://www.servicenow.com/community/community-central-forum/record-is-not-being-created-in-decision-table-with-concatenated/m-p/3201396#M2434</guid>
      <dc:creator>santoshsuta</dc:creator>
      <dc:date>2025-03-10T12:59:17Z</dc:date>
    </item>
  </channel>
</rss>

