Can I do a filter in Google Sheets tool for string contains instead of matches

Describe the problem/error/question

I want to do a filter for column using contains instead of matches, is there a way to do it? Sadly I cannot use filter node for Google Sheets tool

What is the error message (if any)?

Please share your workflow

(Select the nodes on your canvas and use the keyboard shortcuts CMD+C/CTRL+C and CMD+V/CTRL+V to copy and paste the workflow.)

Share the output returned by the last node

Information on your n8n setup

  • n8n version:
  • Database (default: SQLite):
  • n8n EXECUTIONS_PROCESS setting (default: own, main):
  • Running n8n via (Docker, npm, n8n cloud, desktop app):
  • Operating system:

The filtering that is available in this node is, as far as I can tell, something that n8n adds to the base Sheets API. n8n appears to be fetching the entire content of the sheet and then limiting what the node outputs in JS code. As it is currently written, there does not appear to be any support for wildcards, regex matching, contains() etc.

The Google Sheets API does not appear to have any sort of server-side value-matching/filtering at all, but if you want to try, here’s a “starting point” HTTP Request node that is roughly equivalent to the Google Sheets Get row(s) in sheet operation.

BTW, if you want to create a “Tool” that fetches data from Google Sheets and then Filters the result using value matching, etc (i.e. Filter node), you could try to encapsulate all of that in a sub-workflow and use the Call n8n Workflow Tool with your AI Agent.

1 Like