# N8N Search with numbers in text field results in 400 error: type mismatch

**URL:** <https://forum.seatable.com/t/n8n-search-with-numbers-in-text-field-results-in-400-error-type-mismatch/3435>\
**Category:** API\
**Tags:** n8n\
**Created:** [May 2, 2024, 11:28am UTC](https://forum.seatable.com/t/n8n-search-with-numbers-in-text-field-results-in-400-error-type-mismatch/3435 "2024-05-02T11:28:48Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![lcx\_at](https://forum.seatable.com/user_avatar/forum.seatable.com/lcx_at/32/2402_2.png) [@lcx\_at](https://forum.seatable.com/u/lcx_at)\
**Post date:** [May 2, 2024, 11:28am UTC](https://forum.seatable.com/t/n8n-search-with-numbers-in-text-field-results-in-400-error-type-mismatch/3435/1 "2024-05-02T11:28:48Z")

</div>

I have this search in N8N

 ![CleanShot_2024-05-02_at_13.21.53](https://forum.seatable.io/uploads/default/original/2X/a/afa896813a431cc2edba83f6d95775039bf59017.png)

But the column InvoiceNumber is a text in seatable which results in this error message: `400 - {"error_message":"type mismatch: Invoices.InvoiceNumber = 2.024031203e+09"} - type mismatch: Invoices.InvoiceNumber = 2.024031203e+09`

If I add a letter to the search, for example A2024031203 and change the value in seatable as well, the search works as expected.  
I tried adding quotes (" ’ and `) but that didn’t help.  
How can I force n8n search to treat it as a string? Using something like

```javascript
{{ String($json["Invoice Number"]) }}

```

also didn’t help and the original data is actually a string anyway.

```json
{
  "Category": "Invoice",
  "Invoice Number": "2024031203",
  "Invoice Date": "2024-04-30",
  "Due Date": "2024-05-03"
}

```

---

<div class="post-metadata">

**Author:** ![bha](https://forum.seatable.com/user_avatar/forum.seatable.com/bha/32/4702_2.png) [@bha](https://forum.seatable.com/u/bha)\
**Post date:** [May 2, 2024, 12:32pm UTC](https://forum.seatable.com/t/n8n-search-with-numbers-in-text-field-results-in-400-error-type-mismatch/3435/2 "2024-05-02T12:32:01Z")

</div>

Hi @lcx_at, it looks like a bug to me, because as you said, forcing the type of the search term doesn’t help…

Depending on what you need to do after that step, you could use this workaround :

1. Create a ‘Get many’ SeaTable node to get all the rows of your table (or view) ( **don’t forget to uncheck the simplify output switch** so you can access the rows’ ids in the next nodes)
2. Add an ‘If’ node that make the test you need (see below)  
 ![if_config](https://forum.seatable.io/uploads/default/original/2X/0/04e66807673f38253bd6be3a51f8d67cd7a08c37.png)
3. In the next steps, you can access the corresponding rows using their ids  
(`{{ $('ListRows').item.json._id }}`)

Hope this helps…  
Bests,  
Benjamin

---

<div class="post-metadata">

**Author:** ![lcx\_at](https://forum.seatable.com/user_avatar/forum.seatable.com/lcx_at/32/2402_2.png) [@lcx\_at](https://forum.seatable.com/u/lcx_at)\
**Post date:** [May 2, 2024, 12:45pm UTC](https://forum.seatable.com/t/n8n-search-with-numbers-in-text-field-results-in-400-error-type-mismatch/3435/3 "2024-05-02T12:45:21Z")

</div>

I used the find by sql from Seatable which doesn’t have native support in n8n but can be accomplished with a base call.  
Getting the URL is still a bit of a pain, I use the web inspector to find it

 ![CleanShot_2024-05-02_at_14.43.51](https://forum.seatable.io/uploads/default/original/2X/f/f5b694df7ce8fc274d71c259fcdea483f1833e51.png)

and then used this to trigger the search:

```json
{
  "sql": "select _id,InvoiceNumber from `Invoices` where InvoiceNumber = '{{ $json["Invoice Number"] }}' LIMIT 1",
  "convert_keys": true
}

```

but is a bit overkill just for searching an invoice number.
