# SOQL Query Invalid Field Id in SalesForce Lookup

**URL:** <https://connective.celigo.com/t/soql-query-invalid-field-id-in-salesforce-lookup/167>\
**Category:** Integrator.io\
**Tags:** sql, error-handling, lookup, salesforce, netsuite\
**Created:** [April 11, 2024, 12:05pm UTC](https://connective.celigo.com/t/soql-query-invalid-field-id-in-salesforce-lookup/167 "2024-04-11T12:05:43Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![aishwaryamj](https://avatars.discourse-cdn.com/v4/letter/a/779978/32.png) [@aishwaryamj](https://connective.celigo.com/u/aishwaryamj)\
**Post date:** [April 11, 2024, 12:05pm UTC](https://connective.celigo.com/t/soql-query-invalid-field-id-in-salesforce-lookup/167/1 "2024-04-11T12:05:43Z")

</div>

We have a custom record that groups multiple sales orders based on certain criteria in Sales Force. I am integrating the Sales Order Items from the Custom record to a Sales Order Record in NetSuite. I am trying to get the Sales Order Item list in this custom record through a lookup. It is a real time sync.

 ![5301043caa20740200000001-1263fe53f8c849d788666c3569628c35.png](https://us1.discourse-cdn.com/flex001/uploads/celigo/original/2X/0/004167b1e28978e841045f4ed856ae67a8956049.png)

The SOQL is SELECT Name FROM Sales\_Order\_Item\_\_c WHERE Grouped\_Sales\_Orders\_\_c = '{{record.Record\_ID\_\_c}}' , where the Record\_ID\_\_c should be the value of the currently triggered Record Id. When I preview this i get the error,

 ![5301043caa20740200000001-9d22434668af4cef8143a969bbde6494.png](https://us1.discourse-cdn.com/flex001/uploads/celigo/original/2X/6/63bfe4b1842a7ad41ea142c59b106601ed315054.png)

When I preview this i get the error,

 ![5301043caa20740200000001-affc323e414e4cba81da0f77270ab041.png](https://us1.discourse-cdn.com/flex001/uploads/celigo/original/2X/a/af06d690d27090fce9f726ca184bfd3d771a95a5.png)

But when i hardcode the value of the same field(Record ID), the query works. What might the issue be?

---

<div class="post-metadata">

**Author:** ![lakhanbhagnani](https://avatars.discourse-cdn.com/v4/letter/l/ce7236/32.png) [@lakhanbhagnani](https://connective.celigo.com/u/lakhanbhagnani)\
**Post date:** [April 24, 2024, 10:15am UTC](https://connective.celigo.com/t/soql-query-invalid-field-id-in-salesforce-lookup/167/2 "2024-04-24T10:15:52Z")

</div>

Hey Aishwarya,

It is because the Mock data has the value of {{record.Record\_ID\_\_c}} as "Record\_ID\_\_c" .

You can modify the mock data and update the real-time value there; if you click preview, you'll see the right output.

Let me know if that helps.
