# Salesforce -Bind Variable Error

**URL:** <https://connective.celigo.com/t/salesforce-bind-variable-error/319>\
**Category:** Integrator.io\
**Tags:** sql, error-handling, lookup, salesforce\
**Created:** [October 27, 2023, 1:24pm UTC](https://connective.celigo.com/t/salesforce-bind-variable-error/319 "2023-10-27T13:24:07Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![daveguderian](https://avatars.discourse-cdn.com/v4/letter/d/ce7236/32.png) [@daveguderian](https://connective.celigo.com/u/daveguderian)\
**Post date:** [October 27, 2023, 1:24pm UTC](https://connective.celigo.com/t/salesforce-bind-variable-error/319/1 "2023-10-27T13:24:07Z")

</div>

I am trying to get my lookup query for Date of Birth and Social Security number to work and am receiving an error. If I write these queries individually (as their own distinct lookup) they work fine, but when I combine them it is throwing me this error despite the fact that the query does run and produces results. Can someone help me format this correctly for Salesforce and help me understand what I did incorrectly?

```
select IntPS __Date_Of_Birth__ c, IntPS __Social_Security_Number__ c, Plan_Member_SFID __c from IntPS__ Patient __c where IntPS__ Date_Of_Birth __c = {{data.PrimaryMembersDateOfBirth}}and IntPS__ Social_Security_Number__c = '{{data.PrimarySSN}}'
```

 ![5301043caa20740200000001-7dc52ab46cdd48beae9f3e3a42fd6808.png](https://us1.discourse-cdn.com/flex001/uploads/celigo/original/2X/7/7a2e2518ae6e15f6bf9da3df1ad71e74f8a61491.png)

---

<div class="post-metadata">

**Author:** ![daveguderian](https://avatars.discourse-cdn.com/v4/letter/d/ce7236/32.png) [@daveguderian](https://connective.celigo.com/u/daveguderian)\
**Post date:** [October 27, 2023, 1:43pm UTC](https://connective.celigo.com/t/salesforce-bind-variable-error/319/2 "2023-10-27T13:43:20Z")

</div>

Additionally, here are my result mappings.

 ![5301043caa20740200000001-47496e8dc81546afa9bc0998fb619283.png](https://us1.discourse-cdn.com/flex001/uploads/celigo/original/2X/b/b3ccd1f3f2560e68354afa3c08c9cc1117a24d4a.png)

---

<div class="post-metadata">

**Author:** ![dhilips](https://avatars.discourse-cdn.com/v4/letter/d/fbc32d/32.png) [@dhilips](https://connective.celigo.com/u/dhilips)\
**Post date:** [October 27, 2023, 3:17pm UTC](https://connective.celigo.com/t/salesforce-bind-variable-error/319/3 "2023-10-27T15:17:24Z")

</div>

Hi Dave,

The error message states that r\_SSN is passed as a plain string. Would you please remove the filters and add fresh ones with the same configuration? Verify that the settings are being set straight from the fields list. It's not reproducible for us. To understand better, Could you please tell me if you set the "Value" earlier? and later changed to "fields".

 ![5301043caa20740200000001-a49b138dec20433fbbe30d70a43ff8f8.png](https://us1.discourse-cdn.com/flex001/uploads/celigo/original/2X/7/7c6d5cc95c8fba76c2c5e2db9fddec626ebd8a99.png)

---

<div class="post-metadata">

**Author:** ![daveguderian](https://avatars.discourse-cdn.com/v4/letter/d/ce7236/32.png) [@daveguderian](https://connective.celigo.com/u/daveguderian)\
**Post date:** [October 27, 2023, 3:42pm UTC](https://connective.celigo.com/t/salesforce-bind-variable-error/319/4 "2023-10-27T15:42:21Z")

</div>

Thank you Dhilip. I did have it set from the "Value" because if I select "Field" it is not letting me save it for some reason.

 ![5301043caa20740200000001-84458c1dc990406789700bd371ac4603.png](https://us1.discourse-cdn.com/flex001/uploads/celigo/original/2X/7/7eadac53388d64a0dbb273d1e9bbd9d647f5fa68.png)

---

<div class="post-metadata">

**Author:** ![daveguderian](https://avatars.discourse-cdn.com/v4/letter/d/ce7236/32.png) [@daveguderian](https://connective.celigo.com/u/daveguderian)\
**Post date:** [October 27, 2023, 3:49pm UTC](https://connective.celigo.com/t/salesforce-bind-variable-error/319/5 "2023-10-27T15:49:45Z")

</div>

Update: I am able to add 1 criteria and save, but adding the second does not allow me to save still.

---

<div class="post-metadata">

**Author:** ![dhilips](https://avatars.discourse-cdn.com/v4/letter/d/fbc32d/32.png) [@dhilips](https://connective.celigo.com/u/dhilips)\
**Post date:** [October 27, 2023, 4:05pm UTC](https://connective.celigo.com/t/salesforce-bind-variable-error/319/6 "2023-10-27T16:05:41Z")

</div>

@daveguderian Can you please share what error you're facing while saving with two filters?

---

<div class="post-metadata">

**Author:** ![daveguderian](https://avatars.discourse-cdn.com/v4/letter/d/ce7236/32.png) [@daveguderian](https://connective.celigo.com/u/daveguderian)\
**Post date:** [October 27, 2023, 4:09pm UTC](https://connective.celigo.com/t/salesforce-bind-variable-error/319/7 "2023-10-27T16:09:47Z")

</div>

@dhilips - I just figured out why it was doing that and was able to get it to save.

Does this look correct based on the filters:

```
((IntPS __Social_Security_Number__ c = {{{string r_SSN}}}) AND (IntPS __Date_Of_Birth__ c = {{{date r_DOB}}}))
```

---

<div class="post-metadata">

**Author:** ![dhilips](https://avatars.discourse-cdn.com/v4/letter/d/fbc32d/32.png) [@dhilips](https://connective.celigo.com/u/dhilips)\
**Post date:** [October 30, 2023, 3:05pm UTC](https://connective.celigo.com/t/salesforce-bind-variable-error/319/8 "2023-10-30T15:05:02Z")

</div>

@daveguderian Is above filter expression solved your issue?
