BC.QUERYTABLEFILTER

Overview

Use the BC.QUERYTABLEFILTER function to create a string that is ready to use as input for the Filter argument in the BC.QUERYTABLE function.

Syntax

=BC.QUERYTABLEFILTER(
  ConnectionName,
  Table,
  Column,
  Criteria,
  AnotherColumnOrCriteria1,
  AnotherColumnOrCriteria2,
  ...
)

Arguments

Argument

Required / Optional

Description

ConnectionName

Optional

Provide one of the following values:

OR

Omit the argument to return results for all compatible connections with default aggregation settings.

Table

Required

Table name. Use the BC.EXPANDTABLERANGE function to retrieve a list of tables available for querying.

Column

Required

Name of the column to be filtered. Use the BC.TABLEDEFINITION function to retrieve available column names.

Also applies to flow fields and flow filters – see the dedicated guide.

To filter on a field from a related table, use the -> operator in one of the following forms:

  • RelatedTable->RelatedTableField - navigates by table name. Use when the main table has exactly one column pointing to the related table. Related table names are listed in BC.TABLEDEFINITION results.

  • ColumnName->RelatedTableField - navigates from a specific column in the main table to a field in the related table. Use this form when the main table has more than one column pointing to the same related table. Related fields are listed in BC.TABLEDEFINITION results.

The related table must also contribute at least one field to the Select argument of the BC.QUERYTABLE formula that uses this filter. Rows that don't match a related-field filter are excluded from the results.

Filtering on fields from related tables depends on the Velixo Extension for Business Central - see the requirements page for the minimum version.

Criteria

Required

A criterion or set of criteria that you want your filtered results to meet.

Criteria can be one of the following:

  • a value – the argument should be equal to the value

  • an Excel comparison operator (<>, >, <, =, >=, <=), followed by a value

The argument can be a single value, an array of values, or a range of cells.
If the argument is an array or a range of cells, each value will be considered an alternative and joined via a logical OR as part of a bracketed group.

AnotherColumnOrCriteria1

Optional

Second column used for filtering.

Accepts the same forms as Column, including fields from related tables.

AnotherColumnOrCriteria2

Optional (Required if previous argument is specified)

Criterion for the second filter.

Examples

Filter on a column value

=BC.QUERYTABLEFILTER(,"Contact","City", "Vancouver")

Description: Returns a filter for the BC.QUERYTABLE function. Only returns results from the table Contact where the value in the column City is Vancouver. The filter is then used with a BC.QUERYTABLE formula.

image-20260105-151332.png
=BC.QUERYTABLEFILTER(,"Sales Line","Bill-to Customer No.->Name","Adatum Corporation")

Description: Returns a filter for the BC.QUERYTABLE function. Only returns Sales Line records where the customer name held in the related Customer table is Adatum Corporation, matched by name rather than by the customer number on the sales line. The BC.QUERYTABLE formula using this filter must include a field from the Customer table in its Select argument.

image-20260806-104625.png