Skip to content

筛选(Filter)#

根据条件筛选项目。如果项目符合条件,筛选节点会将其传递到筛选节点输出的下一个节点。如果项目不符合条件,筛选节点会将其从输出中省略。

🌐 Filter items based on a condition. If the item meets the condition, the Filter node passes it on to the next node in the Filter node output. If the item doesn't meet the condition, the Filter node omits the item from its output.

节点参数(Node parameters)#

创建过滤器比较 条件 以执行你的过滤器。

🌐 Create filter comparison Conditions to perform your filter.

  • 使用数据类型下拉菜单选择条件的数据类型和比较操作类型。例如,要筛选某个日期之后的日期,请选择 日期和时间 > 在之后
  • 根据你选择的数据类型和比较方式,条件中要输入的字段和值会有所不同。有关按数据类型列出的所有比较的完整列表,请参阅可用的数据类型比较

选择 添加条件 来创建更多条件。

🌐 Select Add condition to create more conditions.

合并条件(Combining conditions)#

你可以选择保留项目:

🌐 You can choose to keep items:

  • 当它们满足所有条件时:创建两个或更多条件,并在它们之间的下拉菜单中选择 AND(并且)
  • 当它们符合任一条件时:创建两个或更多条件,并在它们之间的下拉菜单中选择 或(OR)

你不能同时创建 AND 和 OR 规则。

🌐 You can't create a mix of AND and OR rules.

节点选项(Node options)#

  • 忽略大小写:是否忽略字母大小写(打开)或区分大小写(关闭)。
  • 较宽松的类型验证:是否希望 n8n 根据你选择的操作符尝试转换值类型(开启时)或不进行转换(关闭时)。当你的节点出现“类型错误”时,请开启此选项。

模板和示例(Templates and examples)#

Template widget placeholder.

Available data type comparisons#

String#

String data type supports these comparisons:

  • exists
  • does not exist
  • is empty
  • is not empty
  • is equal to
  • is not equal to
  • contains
  • does not contain
  • starts with
  • does not start with
  • ends with
  • does not end with
  • matches regex
  • does not match regex

Number#

Number data type supports these comparisons:

  • exists
  • does not exist
  • is empty
  • is not empty
  • is equal to
  • is not equal to
  • is greater than
  • is less than
  • is greater than or equal to
  • is less than or equal to

Date & Time#

Date & Time data type supports these comparisons:

  • exists
  • does not exist
  • is empty
  • is not empty
  • is equal to
  • is not equal to
  • is after
  • is before
  • is after or equal to
  • is before or equal to

Boolean#

Boolean data type supports these comparisons:

  • exists
  • does not exist
  • is empty
  • is not empty
  • is true
  • is false
  • is equal to
  • is not equal to

Array#

Array data type supports these comparisons:

  • exists
  • does not exist
  • is empty
  • is not empty
  • contains
  • does not contain
  • length equal to
  • length not equal to
  • length greater than
  • length less than
  • length greater than or equal to
  • length less than or equal to

Object#

Object data type supports these comparisons:

  • exists
  • does not exist
  • is empty
  • is not empty