# IF node not working: find string in array

**URL:** <https://community.n8n.io/t/if-node-not-working-find-string-in-array/51491>\
**Category:** Questions\
**Created:** [August 9, 2024, 8:57am UTC](https://community.n8n.io/t/if-node-not-working-find-string-in-array/51491 "2024-08-09T08:57:12Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![carlo](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/carlo/32/42785_2.png) [@carlo](https://community.n8n.io/u/carlo)\
**Post date:** [August 9, 2024, 8:57am UTC](https://community.n8n.io/t/if-node-not-working-find-string-in-array/51491/1 "2024-08-09T08:57:12Z")

</div>

## Describe the problem/error/question

Hi, I want to have an IF node that checks whether a filename from the node “Search PDFs” does already exist in the array of filenames based on the column “Dateiname” of the node “Write Google Sheets”.

I cannot get the IF node to work properly.

## What is the error message (if any)?

No data found for item-index: “1” [item 1]

Try changing the type of comparison. Alternatively you can enable ‘Less Strict Type Validation’ in the options.

## Please share your workflow

## Share the output returned by the last node

No data found for item-index: “1” [item 1]

Try changing the type of comparison. Alternatively you can enable ‘Less Strict Type Validation’ in the options.

## Information on your n8n setup

- **n8n version: 1.52.2**
- **Database (default: SQLite): SQLite**
- **n8n EXECUTIONS\_PROCESS setting (default: own, main): own, main**
- **Running n8n via (Docker, npm, n8n cloud, desktop app): Docker**
- **Operating system: DietPi v9.5.1**

---

<div class="post-metadata">

**Author:** ![barn4k](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/barn4k/32/8170_2.png) [@barn4k](https://community.n8n.io/u/barn4k)\
**Post date:** [August 9, 2024, 10:07am UTC](https://community.n8n.io/t/if-node-not-working-find-string-in-array/51491/2 "2024-08-09T10:07:16Z")

</div>

hello @carlo

Why are you not using the filter in the Sheet node to filter out the matching names?

According to your question, you’ll need a different workflow:  
a gDrive node with a list of PDF files  
a gSheet node with a list of filenames  
a Merge node linking both with outer-join matching style

---

<div class="post-metadata">

**Author:** ![carlo](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/carlo/32/42785_2.png) [@carlo](https://community.n8n.io/u/carlo)\
**Post date:** [August 9, 2024, 11:45am UTC](https://community.n8n.io/t/if-node-not-working-find-string-in-array/51491/3 "2024-08-09T11:45:32Z")

</div>

Thanks alot @barn4k, that works fine! 🙂

---

<div class="post-metadata">

**Author:** ![system](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/system/32/195824_2.png) [@system](https://community.n8n.io/u/system)\
**Post date:** [November 7, 2024, 11:45am UTC](https://community.n8n.io/t/if-node-not-working-find-string-in-array/51491/4 "2024-11-07T11:45:58Z")

</div>

Closed on November 7, 2024, 11:45am UTC

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.
