<?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: Look Up select box is not working via integration in Developer forum</title>
    <link>https://www.servicenow.com/community/developer-forum/look-up-select-box-is-not-working-via-integration/m-p/3580635#M1261237</link>
    <description>&lt;P&gt;&lt;FONT color="#000000"&gt;Hi Sumanth,&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000000"&gt;This is a common "gotcha" when transitioning logic from a background script to a Business Rule. The discrepancy usually happens because the background script queries the database directly, while the Business Rule interacts with the current object in memory during a transaction.&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000000"&gt;Look Up Select Box and Reference variables inherently store the sys_id at the database level. To fix this, you need to ensure your getVariableJSON function in the Script Include explicitly requests the display value.&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000000"&gt;Instead of just grabbing the variable's value, make sure you are using .getDisplayValue() on the specific element (e.g., current.variables.your_variable.getDisplayValue()). Also, double-check your Script Include's accessibility and ensure it is properly handling the static call CustomScriptInclude.getVariableJSON() if you aren't instantiating it with new in the Business Rule.&lt;/FONT&gt;&lt;/P&gt;</description>
    <pubDate>Wed, 29 Jul 2026 08:00:14 GMT</pubDate>
    <dc:creator>NehaG8791370651</dc:creator>
    <dc:date>2026-07-29T08:00:14Z</dc:date>
    <item>
      <title>Look Up select box is not working via integration</title>
      <link>https://www.servicenow.com/community/developer-forum/look-up-select-box-is-not-working-via-integration/m-p/3579271#M1261046</link>
      <description>&lt;P&gt;1) In the background script is working fine :&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;P&gt;var taskSysId = '5f1f516dc35203d05a76d5fe0501315d';&lt;BR /&gt;var grTask = new GlideRecord('sc_task');&lt;/P&gt;&lt;P&gt;if (grTask.get(taskSysId)) {&lt;BR /&gt;var ritmSysId = grTask.request_item.toString();&lt;BR /&gt;gs.info("Found Parent RITM: " + ritmSysId);&lt;BR /&gt;&lt;BR /&gt;var test = new x_custom_scope.CustomScriptInclude();&lt;BR /&gt;var variableJSON = test.getVariableJSON(ritmSysId);&lt;BR /&gt;&lt;BR /&gt;gs.info("Variable JSON Output:\n" + JSON.stringify(variableJSON, null, 4));&lt;BR /&gt;} else {&lt;BR /&gt;gs.error("Could not find an sc_task record with the provided sys_id: " + taskSysId);&lt;BR /&gt;}&lt;/P&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&lt;BR /&gt;2) when i run via Business rules and script includes its getting the Sys_id Instead of script inlcude in the payload generation&lt;BR /&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;P&gt;...&lt;BR /&gt;var variableJSON = CustomScriptInclude.getVariableJSON(current.request_item.toString());&lt;BR /&gt;....&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;var payload = {};&lt;BR /&gt;...&lt;BR /&gt;payload.variables = variableJSON;&lt;BR /&gt;....&lt;/P&gt;&lt;P&gt;// Genericized custom table name&lt;BR /&gt;var transactionlogGr = new GlideRecord('x_custom_scope_transaction_log');&lt;BR /&gt;transactionlogGr.initialize();&lt;/P&gt;&lt;P&gt;transactionlogGr.payload = JSON.stringify(payload);&lt;/P&gt;&lt;P&gt;.......................&lt;/P&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Mon, 27 Jul 2026 04:42:15 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/look-up-select-box-is-not-working-via-integration/m-p/3579271#M1261046</guid>
      <dc:creator>SumanthK7729163</dc:creator>
      <dc:date>2026-07-27T04:42:15Z</dc:date>
    </item>
    <item>
      <title>Re: Look Up select box is not working via integration</title>
      <link>https://www.servicenow.com/community/developer-forum/look-up-select-box-is-not-working-via-integration/m-p/3579833#M1261108</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://www.servicenow.com/community/user/viewprofilepage/user-id/455879"&gt;@SumanthK7729163&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;If you could share the complete code for the &lt;/SPAN&gt;&lt;SPAN&gt;CustomScriptInclude&lt;/SPAN&gt;&lt;SPAN&gt;, especially the &lt;/SPAN&gt;&lt;SPAN&gt;getVariableJSON()&lt;/SPAN&gt;&lt;SPAN&gt; method, it would be much easier to determine why it returns only the sys_id when called from the Business Rule, while it returns the expected JSON when executed from the Background Script.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 28 Jul 2026 00:25:01 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/look-up-select-box-is-not-working-via-integration/m-p/3579833#M1261108</guid>
      <dc:creator>Rafael Batistot</dc:creator>
      <dc:date>2026-07-28T00:25:01Z</dc:date>
    </item>
    <item>
      <title>Re: Look Up select box is not working via integration</title>
      <link>https://www.servicenow.com/community/developer-forum/look-up-select-box-is-not-working-via-integration/m-p/3579848#M1261110</link>
      <description>&lt;P&gt;&lt;a href="https://www.servicenow.com/community/user/viewprofilepage/user-id/455879"&gt;@SumanthK7729163&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;what's your actual requirement?&lt;/P&gt;
&lt;P&gt;share some screenshots etc&lt;/P&gt;</description>
      <pubDate>Tue, 28 Jul 2026 02:59:52 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/look-up-select-box-is-not-working-via-integration/m-p/3579848#M1261110</guid>
      <dc:creator>Ankur Bawiskar</dc:creator>
      <dc:date>2026-07-28T02:59:52Z</dc:date>
    </item>
    <item>
      <title>Re: Look Up select box is not working via integration</title>
      <link>https://www.servicenow.com/community/developer-forum/look-up-select-box-is-not-working-via-integration/m-p/3579858#M1261112</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://www.servicenow.com/community/user/viewprofilepage/user-id/455879"&gt;@SumanthK7729163&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Could you please try to replace this code in BR and try like this .&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;From :&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;var variableJSON = CustomScriptInclude.getVariableJSON(current.request_item.toString());&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;To:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;var test = new &lt;STRONG&gt;x_custom_scope&lt;/STRONG&gt;.CustomScriptInclude();&lt;BR /&gt;var variableJSON = test.getVariableJSON(current.request_item.toString());&amp;nbsp; //the way you did it in background script&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 28 Jul 2026 03:44:03 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/look-up-select-box-is-not-working-via-integration/m-p/3579858#M1261112</guid>
      <dc:creator>Tanushree Maiti</dc:creator>
      <dc:date>2026-07-28T03:44:03Z</dc:date>
    </item>
    <item>
      <title>Re: Look Up select box is not working via integration</title>
      <link>https://www.servicenow.com/community/developer-forum/look-up-select-box-is-not-working-via-integration/m-p/3579863#M1261114</link>
      <description>&lt;P&gt;below is in the scoped Application In the sc_task table after insert or update&lt;BR /&gt;&amp;lt;-----Business rule code---&amp;gt;&lt;/P&gt;&lt;P&gt;(function executeRule(current, previous /*null when async*/ ) {&lt;/P&gt;&lt;P&gt;var debug = (gs.getProperty('x_4dai_vi.vendorIntegration.debug', false).toString() == "true");&lt;BR /&gt;if (debug) {&lt;BR /&gt;gs.info("Business Rule: VI: Catalog Task Assigned - Triggered");&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;var vendorIntegrationOutboundUtils = new x_4dai_vi.Vendor_Integration_OutboundUtils();&lt;BR /&gt;var processSysid = vendorIntegrationOutboundUtils.getProcessSysID('request_management');&lt;BR /&gt;var methodSysid = vendorIntegrationOutboundUtils.getMethodSysId(processSysid, 'taskAssigned');&lt;BR /&gt;var processPriority = vendorIntegrationOutboundUtils.getProcessPriority('request_management'); var requestedforDetails = {};&lt;BR /&gt;requestedforDetails['first_name'] = current.request_item.request.requested_for.first_name.toString();&lt;BR /&gt;requestedforDetails['last_name'] = current.request_item.request.requested_for.last_name.toString();&lt;BR /&gt;requestedforDetails['email_address'] = current.request_item.request.requested_for.email.toString();&lt;BR /&gt;requestedforDetails['user_name'] = current.request_item.request.requested_for.user_name.toString();&lt;/P&gt;&lt;P&gt;var requestedbyDetails = {};&lt;BR /&gt;requestedbyDetails['first_name'] = current.request_item.opened_by.first_name.toString();&lt;BR /&gt;requestedbyDetails['last_name'] = current.request_item.opened_by.last_name.toString();&lt;BR /&gt;requestedbyDetails['email_address'] = current.request_item.opened_by.email.toString();&lt;BR /&gt;requestedbyDetails['user_name'] = current.request_item.opened_by.user_name.toString();&lt;/P&gt;&lt;P&gt;var catalogitemDetails = {};&lt;BR /&gt;catalogitemDetails['name'] = current.request_item.cat_item.name.toString();&lt;BR /&gt;catalogitemDetails['sys_id'] = current.request_item.cat_item.sys_id.toString();&lt;BR /&gt;catalogitemDetails['catalog'] = current.request_item.cat_item.sc_catalogs.getDisplayValue();&lt;BR /&gt;catalogitemDetails['category'] = current.request_item.cat_item.category.getDisplayValue();&lt;/P&gt;&lt;P&gt;// Prepare some additional requested item details&lt;BR /&gt;var requestedItemDetails = {&lt;BR /&gt;number: current.request_item.number.toString(),&lt;BR /&gt;service: {&lt;BR /&gt;value: current.request_item.business_service.toString(),&lt;BR /&gt;display_value: current.request_item.business_service.getDisplayValue(),&lt;BR /&gt;},&lt;BR /&gt;service_offering: {&lt;BR /&gt;value: current.request_item.service_offering.toString(),&lt;BR /&gt;display_value: current.request_item.service_offering.number.toString(),&lt;BR /&gt;},&lt;BR /&gt;application_service: {&lt;BR /&gt;value: current.request_item.u_service_instance.toString(),&lt;BR /&gt;display_value: current.request_item.u_service_instance.getDisplayValue(),&lt;BR /&gt;},&lt;BR /&gt;cmdb_ci: vendorIntegrationOutboundUtils.prepareCI(current.request_item.cmdb_ci.toString()),&lt;BR /&gt;};&lt;/P&gt;&lt;P&gt;// Prepare some additional request details&lt;BR /&gt;var requestDetails = {&lt;BR /&gt;delivery_address: current.request_item.request.delivery_address.toString(),&lt;BR /&gt;special_instructions: current.request_item.request.special_instructions.toString(),&lt;BR /&gt;};&lt;/P&gt;&lt;P&gt;var ciDetails = vendorIntegrationOutboundUtils.prepareCIListInJSON(current.cmdb_ci.toString());&lt;BR /&gt;var variableJSON = vendorIntegrationOutboundUtils.getVariableJSON(current.request_item.toString());&lt;BR /&gt;//var attachmentJSON = vendorIntegrationOutboundUtils.getAttachmentJson(current.request_item.toString());&lt;/P&gt;&lt;P&gt;var payload = {};&lt;BR /&gt;payload.sys_class_name = current.sys_class_name.toString();&lt;BR /&gt;payload.servicenow_process = "request_management";&lt;BR /&gt;payload.servicenow_method = "taskAssigned";&lt;/P&gt;&lt;P&gt;payload.number = current.number.toString();&lt;BR /&gt;payload.requested_item_number = current.request_item.number.toString();&lt;BR /&gt;payload.requested_item = requestedItemDetails;&lt;BR /&gt;payload.request = requestDetails;&lt;BR /&gt;payload.catalog_item = catalogitemDetails;&lt;BR /&gt;payload.requested_for = requestedforDetails;&lt;BR /&gt;payload.requested_by = requestedbyDetails;&lt;BR /&gt;payload.service = current.business_service.getDisplayValue();&lt;BR /&gt;payload.service_offering = current.service_offering.number.toString();&lt;BR /&gt;payload.application_service = current.u_service_instance.getDisplayValue();&lt;BR /&gt;if (ciDetails) {&lt;BR /&gt;payload.cmdb_ci = JSON.parse(ciDetails);&lt;BR /&gt;} else {&lt;BR /&gt;payload.cmdb_ci = "";&lt;BR /&gt;}&lt;BR /&gt;payload.description = current.description.toString();&lt;BR /&gt;payload.short_description = current.short_description.toString();&lt;BR /&gt;payload.priority = current.priority.toString();&lt;BR /&gt;payload.assignment_group = current.assignment_group.getDisplayValue();&lt;BR /&gt;payload.variables = variableJSON;&lt;BR /&gt;//payload.attachments = attachmentJSON;&lt;BR /&gt;payload.legal_entity = current.u_legal_entity.toString();&lt;/P&gt;&lt;P&gt;var transactionlogGr = new GlideRecord('x_4dai_vi_transaction_log');&lt;BR /&gt;transactionlogGr.initialize();&lt;BR /&gt;transactionlogGr.direction = "Outbound";&lt;BR /&gt;transactionlogGr.method = methodSysid;&lt;BR /&gt;transactionlogGr.process = processSysid;&lt;BR /&gt;transactionlogGr.u_processing_priority = processPriority;&lt;BR /&gt;transactionlogGr.payload = JSON.stringify(payload);&lt;BR /&gt;transactionlogGr.integration_account = current.assignment_group.u_integration_account;&lt;BR /&gt;transactionlogGr.related_task = current.sys_id;&lt;BR /&gt;transactionlogGr.state = "Ready";&lt;BR /&gt;var res = transactionlogGr.insert();})(current, previous);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;lt;----Script include function and this is also a scoped application-----&amp;gt;&lt;/P&gt;&lt;P&gt;getVariableJSON: function(requestItemsysid) {&lt;BR /&gt;var finalJson = {};&lt;/P&gt;&lt;P&gt;var grRITM = new GlideRecord('sc_req_item');&lt;BR /&gt;if (grRITM.get(requestItemsysid)) {&lt;BR /&gt;var vars = grRITM.variables.getElements(true);&lt;/P&gt;&lt;P&gt;var arMrvs = [];&lt;BR /&gt;var arVariables = [];&lt;BR /&gt;var typenotAllowed = gs.getProperty('x_4dai_vi.notallowed.variable.types.for.outbound');&lt;BR /&gt;var arTypenotAllowed = typenotAllowed.split(',');&lt;/P&gt;&lt;P&gt;for (var i = 0; i &amp;lt; vars.length; i++) {&lt;BR /&gt;var scVar = vars[i];&lt;BR /&gt;if (scVar.isMultiRow()) {&lt;BR /&gt;var jsonMrvs = {};&lt;BR /&gt;jsonMrvs.name = scVar.getLabel();&lt;BR /&gt;jsonMrvs.display_name = scVar.getLabel();&lt;BR /&gt;jsonMrvs.total_rows = scVar.getRowCount();&lt;/P&gt;&lt;P&gt;var rows = scVar.getRows();&lt;BR /&gt;var arRows = [];&lt;BR /&gt;for (var j = 0; j &amp;lt; scVar.getRowCount(); j++) {&lt;BR /&gt;var row = rows[j];&lt;BR /&gt;var cells = row.getCells();&lt;BR /&gt;var arCells = [];&lt;/P&gt;&lt;P&gt;for (var k = 0; k &amp;lt; cells.length; k++) {&lt;BR /&gt;var cell = cells[k];&lt;/P&gt;&lt;P&gt;var jsonCell = {};&lt;BR /&gt;jsonCell.name = cell.getVariableName();&lt;BR /&gt;jsonCell.value = cell.getCellValue();&lt;BR /&gt;jsonCell.display_value = cell.getCellDisplayValue();&lt;BR /&gt;arCells.push(jsonCell);&lt;/P&gt;&lt;P&gt;}&lt;BR /&gt;var jsonRow = {};&lt;BR /&gt;jsonRow.cells = arCells;&lt;BR /&gt;arRows.push(jsonRow);&lt;BR /&gt;}&lt;BR /&gt;jsonMrvs.rows = arRows;&lt;BR /&gt;arMrvs.push(jsonMrvs);&lt;/P&gt;&lt;P&gt;} else {&lt;BR /&gt;var question = scVar.getQuestion();&lt;BR /&gt;if (arTypenotAllowed.indexOf(question.type.toString()) &amp;gt; -1) {&lt;BR /&gt;continue;&lt;BR /&gt;} else {&lt;BR /&gt;var jsonVariables = {};&lt;BR /&gt;jsonVariables.name = question.getName();&lt;BR /&gt;jsonVariables.value = question.getValue();&lt;BR /&gt;jsonVariables.display_value = question.getDisplayValue();&lt;/P&gt;&lt;P&gt;arVariables.push(jsonVariables);&lt;BR /&gt;}&lt;BR /&gt;}&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;finalJson.mrvs = arMrvs;&lt;BR /&gt;finalJson.variables = arVariables;&lt;BR /&gt;}&lt;BR /&gt;return finalJson;&lt;BR /&gt;},&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 28 Jul 2026 04:19:28 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/look-up-select-box-is-not-working-via-integration/m-p/3579863#M1261114</guid>
      <dc:creator>SumanthK7729163</dc:creator>
      <dc:date>2026-07-28T04:19:28Z</dc:date>
    </item>
    <item>
      <title>Re: Look Up select box is not working via integration</title>
      <link>https://www.servicenow.com/community/developer-forum/look-up-select-box-is-not-working-via-integration/m-p/3579864#M1261115</link>
      <description>&lt;P&gt;As is said When i run in background script i am able to get GetDisplay Value from the below line&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;jsonVariables.display_value = question.getDisplayValue();&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;But when actual scipt will run when created via sc_task i am getting the sys_id&lt;/P&gt;</description>
      <pubDate>Tue, 28 Jul 2026 04:20:36 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/look-up-select-box-is-not-working-via-integration/m-p/3579864#M1261115</guid>
      <dc:creator>SumanthK7729163</dc:creator>
      <dc:date>2026-07-28T04:20:36Z</dc:date>
    </item>
    <item>
      <title>Re: Look Up select box is not working via integration</title>
      <link>https://www.servicenow.com/community/developer-forum/look-up-select-box-is-not-working-via-integration/m-p/3579865#M1261116</link>
      <description>&lt;P&gt;I tried this way as well but during the creation of payload this is getting impacted during the ccreation json format an html tags will come here&lt;/P&gt;</description>
      <pubDate>Tue, 28 Jul 2026 04:20:53 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/look-up-select-box-is-not-working-via-integration/m-p/3579865#M1261116</guid>
      <dc:creator>SumanthK7729163</dc:creator>
      <dc:date>2026-07-28T04:20:53Z</dc:date>
    </item>
    <item>
      <title>Re: Look Up select box is not working via integration</title>
      <link>https://www.servicenow.com/community/developer-forum/look-up-select-box-is-not-working-via-integration/m-p/3579999#M1261150</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://www.servicenow.com/community/user/viewprofilepage/user-id/455879"&gt;@SumanthK7729163&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;may you try replace&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;var variableJSON = vendorIntegrationOutboundUtils.getVariableJSON(current.request_item.toString());&lt;BR /&gt;&lt;BR /&gt;to&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;var variableJSON = vendorIntegrationOutboundUtils.getVariableJSON(current.getValue('request_item'));&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;The issue occurs because in scoped Business Rules within ServiceNow, using &lt;/SPAN&gt;&lt;SPAN&gt;⁠current.request_item.toString()⁠&lt;/SPAN&gt;&lt;SPAN&gt; can fail to extract the pure string of the reference &lt;/SPAN&gt;&lt;SPAN&gt;⁠&lt;/SPAN&gt;&lt;SPAN&gt;sys_id⁠&lt;/SPAN&gt;&lt;SPAN&gt;, passing a &lt;/SPAN&gt;&lt;SPAN&gt;⁠GlideElement⁠&lt;/SPAN&gt;&lt;SPAN&gt; object instead. This causes the &lt;/SPAN&gt;&lt;SPAN&gt;⁠GlideRecord⁠&lt;/SPAN&gt;&lt;SPAN&gt; query in the Script Include to fail or behave inconsistently.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;BR /&gt;The correct way to retrieve the &lt;/SPAN&gt;&lt;SPAN&gt;⁠sys_id⁠&lt;/SPAN&gt;&lt;SPAN&gt; as a clean string within the Business Rule context is to use &lt;/SPAN&gt;&lt;SPAN&gt;⁠current.getValue('request_item')⁠&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 28 Jul 2026 09:00:45 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/look-up-select-box-is-not-working-via-integration/m-p/3579999#M1261150</guid>
      <dc:creator>Rafael Batistot</dc:creator>
      <dc:date>2026-07-28T09:00:45Z</dc:date>
    </item>
    <item>
      <title>Re: Look Up select box is not working via integration</title>
      <link>https://www.servicenow.com/community/developer-forum/look-up-select-box-is-not-working-via-integration/m-p/3580074#M1261156</link>
      <description>&lt;P&gt;Thanks mannn!!!&lt;/P&gt;</description>
      <pubDate>Tue, 28 Jul 2026 10:44:51 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/look-up-select-box-is-not-working-via-integration/m-p/3580074#M1261156</guid>
      <dc:creator>SumanthK7729163</dc:creator>
      <dc:date>2026-07-28T10:44:51Z</dc:date>
    </item>
    <item>
      <title>Re: Look Up select box is not working via integration</title>
      <link>https://www.servicenow.com/community/developer-forum/look-up-select-box-is-not-working-via-integration/m-p/3580616#M1261235</link>
      <description>&lt;P&gt;&lt;FONT color="#000000"&gt;Hi Sumanth,&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000000"&gt;This is a classic hurdle when generating integration payloads with Reference or Look Up Select Box variables. Because these variable types inherently store the sys_id as their underlying value in the database, server-side scripts will pull that sys_id by default unless explicitly instructed otherwise.&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000000"&gt;A few things to check in your implementation:&lt;/FONT&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;&lt;P&gt;&lt;FONT color="#000000"&gt;&lt;STRONG&gt;Display Value Extraction:&lt;/STRONG&gt; Inside your getVariableJSON Script Include, ensure you are utilizing .getDisplayValue() rather than just grabbing the value. For example: gr.variables.your_variable_name.getDisplayValue();.&lt;/FONT&gt;&lt;/P&gt;&lt;/LI&gt;&lt;LI&gt;&lt;P&gt;&lt;FONT color="#000000"&gt;&lt;STRONG&gt;Instantiation Differences:&lt;/STRONG&gt; I noticed a slight syntax discrepancy between your snippets. In the background script, you instantiate the Script Include with new x_custom_scope.CustomScriptInclude(). In the Business Rule, you are calling it statically via CustomScriptInclude.getVariableJSON(...). Ensure your Script Include is properly structured to handle static calls if you aren't instantiating it, and double-check your application scopes.&lt;/FONT&gt;&lt;/P&gt;&lt;/LI&gt;&lt;LI&gt;&lt;P&gt;&lt;FONT color="#000000"&gt;&lt;STRONG&gt;Variable Context:&lt;/STRONG&gt; Sometimes Business Rules (especially if running asynchronously) handle the current.variables object differently than a GlideRecord query in a background script.&lt;/FONT&gt;&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;FONT color="#000000"&gt;Updating your Script Include to explicitly map display values for lookup variables should resolve the payload discrepancy.&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 29 Jul 2026 07:34:43 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/look-up-select-box-is-not-working-via-integration/m-p/3580616#M1261235</guid>
      <dc:creator>NehaG8791370651</dc:creator>
      <dc:date>2026-07-29T07:34:43Z</dc:date>
    </item>
    <item>
      <title>Re: Look Up select box is not working via integration</title>
      <link>https://www.servicenow.com/community/developer-forum/look-up-select-box-is-not-working-via-integration/m-p/3580631#M1261236</link>
      <description>&lt;P&gt;&lt;FONT color="#000000"&gt;Hello Sumanth,&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000000"&gt;From a platform architecture perspective, this behavior makes sense. ServiceNow defaults to passing the sys_id for reference and lookup fields to maintain strict referential integrity across its data model.&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000000"&gt;However, when building an integration layer, downstream systems almost always require human-readable strings rather than system identifiers. To make your architecture more robust and scalable, I recommend updating your CustomScriptInclude to act as a centralized serialization utility.&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000000"&gt;You can script it to dynamically inspect the dictionary type of each variable in the requested item. If it detects a reference or lookup type, it should automatically extract and map both the sys_id and the display value into your JSON payload. Abstracting this logic into a universal utility now will prevent your team from having to write custom data transformations for every future integration you build.&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 29 Jul 2026 07:57:18 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/look-up-select-box-is-not-working-via-integration/m-p/3580631#M1261236</guid>
      <dc:creator>VJ_Srivastava</dc:creator>
      <dc:date>2026-07-29T07:57:18Z</dc:date>
    </item>
    <item>
      <title>Re: Look Up select box is not working via integration</title>
      <link>https://www.servicenow.com/community/developer-forum/look-up-select-box-is-not-working-via-integration/m-p/3580635#M1261237</link>
      <description>&lt;P&gt;&lt;FONT color="#000000"&gt;Hi Sumanth,&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000000"&gt;This is a common "gotcha" when transitioning logic from a background script to a Business Rule. The discrepancy usually happens because the background script queries the database directly, while the Business Rule interacts with the current object in memory during a transaction.&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000000"&gt;Look Up Select Box and Reference variables inherently store the sys_id at the database level. To fix this, you need to ensure your getVariableJSON function in the Script Include explicitly requests the display value.&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000000"&gt;Instead of just grabbing the variable's value, make sure you are using .getDisplayValue() on the specific element (e.g., current.variables.your_variable.getDisplayValue()). Also, double-check your Script Include's accessibility and ensure it is properly handling the static call CustomScriptInclude.getVariableJSON() if you aren't instantiating it with new in the Business Rule.&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 29 Jul 2026 08:00:14 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/look-up-select-box-is-not-working-via-integration/m-p/3580635#M1261237</guid>
      <dc:creator>NehaG8791370651</dc:creator>
      <dc:date>2026-07-29T08:00:14Z</dc:date>
    </item>
  </channel>
</rss>

