Passing array variables using Salesforce external connection
concept australia Updated Mar 12, 2026 1 min read enrichments_array_variables_using_salesforce_external_connection.md
You must use single quote strings when making a SOQL query to Salesforce.
Salesforce supports only single quote strings in a SOQL query. Therefore, the following inputs would not be recognized by Salesforce.
JavaScript
let inputs = { "productsArray": '("Tablet10", "Laptop13", "Laptop15")' }Instead, use single quotes as in the following snippet.
JavaScript
let inputs = { "productsArray": "('Tablet10', 'Laptop13', 'Laptop15')" }The following sample script pulls Salesforce IDs.
JavaScript
// Array of Salesforce IDsconst idList = ['0066e00001pGlTUAA0', '0066e00001pGlTTAA0', '0066e00001pGlTPAA0'];
// Create a string to pass to the SOQL IN query// first part: "('" = opening parenthesis and single quote// middle part: idList.join("','") = join all the Salesforce Ids with single quote, a comma and single quote// last part: "')" = single quote and closing parenthesisconst soqlIn = "('" + idList.join("','") + "')";
// inputs to the SOQL query and calling SF connectionconst inputs = {"idList": soqlIn};const response = Salesforce.<yourExternalConnectionVariableName>(inputs);Related topics
53 lines · 2.1 KB
---
title: Passing array variables using Salesforce external connection
description: You must use single quote strings when making a SOQL query to Salesforce.
locale: en-US
canonical_url: https://www.servicenow.com/docs/r/australia/order-management/enrichments\_array\_variables\_using\_salesforce\_external\_connection.html
release: australia
topic_type: concept
last_updated: "2026-03-12"
reading_time_minutes: 1
breadcrumb: [Setting up enrichments and rules scripting, ServiceNow CPQ Configurator, Configure, price, quote apps, Configure, Sales Customer Relationship Management]
---
# Passing array variables using Salesforce external connection
You must use single quote strings when making a SOQL query to Salesforce.
Salesforce supports only single quote strings in a SOQL query. Therefore, the following inputs would not be recognized by Salesforce.
```
let inputs = { "productsArray": '("Tablet10", "Laptop13", "Laptop15")' }
```
Instead, use single quotes as in the following snippet.
```
let inputs = { "productsArray": "('Tablet10', 'Laptop13', 'Laptop15')" }
```
The following sample script pulls Salesforce IDs.
```
// Array of Salesforce IDs
const idList = ['0066e00001pGlTUAA0', '0066e00001pGlTTAA0', '0066e00001pGlTPAA0'];
// Create a string to pass to the SOQL IN query
// first part: "('" = opening parenthesis and single quote
// middle part: idList.join("','") = join all the Salesforce Ids with single quote, a comma and single quote
// last part: "')" = single quote and closing parenthesis
const soqlIn = "('" + idList.join("','") + "')";
// inputs to the SOQL query and calling SF connection
const inputs = {"idList": soqlIn};
const response = Salesforce.<yourExternalConnectionVariableName>(inputs);
```
**Related topics**
[Using external connections with OAuth support](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown)
[Passing data from Salesforce to ServiceNow CPQ fields](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/order-management/enrichments_on_pass_data_from_salesforce_to_logik_io_fields.md)
| title | Passing array variables using Salesforce external connection |
| description | You must use single quote strings when making a SOQL query to Salesforce. |
| locale | en-US |
| canonical_url | https://www.servicenow.com/docs/r/australia/order-management/enrichments\_array\_variables\_using\_salesforce\_external\_connection.html |
| release | australia |
| topic_type | concept |
| last_updated | 2026-03-12 |
| reading_time_minutes | 1 |
| breadcrumb | Setting up enrichments and rules scriptingServiceNow CPQ ConfiguratorConfigurepricequote appsConfigureSales Customer Relationship Management |