To add a condition, perform the following steps:
|1.||In the Filters section, click Add Filter Condition. |
|2.||In the first drop-down list you need to select the name of the object to filter data by its field. By default, the current object, which is selected in the Object list, is used. You can also filter data by fields of its related objects. |
|3.||In the second drop-down list select the name of the field to filter the data by. |
It is not necessary to have this field selected in the Columns list, and thus, present in the returned data. You can filter data by any field of the object, selected in the previous list.
|4.||In the third drop-down list select the kind of the filter to use: value, parameter, relative, or list. |
|o||Value filters are the simplest. They simply compare the selected field with some value (or values) or check whether the field is null. |
For example, the following filter checks if a string field "Type" begins with the word "Customer":
|o||Parameter filters compare the field with a parameter instead of the constant value. You can later specify parameter values before running the query without modifying the query itself. See Query Parameters in Google Sheets Add-on for more information. |
For example, the following filter checks if a datetime field "CreatedDate" values lays within the interval, specified by two parameters:
|o||Relative filters are available only for fields with date or datetime data. They check if the field value belongs to a time period that is relative to the current date. For example, whether the date belongs to current, next, or previous week, month, etc.|
For example, the following filter checks if a datetime field "CreatedDate" values belong to the previous year:
|o||List filters are available only for fields with textual data. They allow you to specify a list of strings and check if the field value belongs to this list. |
For example, the following filter checks if a string field "Type" is equal to one of the list values:
To enter a list of values, after each value press Enter.
|5.||In the third drop-down list select the comparison operator to use - equal to, not equal to, greater than, is null, etc. Note that different comparison operators are available for different field types. |
|6.||Depending on the selected kind of the filter, specify a value or the name of a parameter to compare with, enter a list of values, or select a relative time period. |
You can add as many filter conditions as you need.
To remove a condition, click the Remove Filter cross button in the line of the corresponding condition, on the right.