Skip to main content

FieldLogs

Using Filters in the Master Data Selector Input Element

A Filter is a condition built using operators and operands.

The Master Data Selector input element is populated with Data based on the value produced by the Filter execution. It can be used to select a set of records based on some criteria.

There are three categories of operators available to build Filters:

Category

Operators Available

Relational Operators

These operators enable comparisons to be made. They are used in condition testing.

Operator

Operation

=

Equals

!=

Does not equal

<

Less than

>

Greater than

<=

Less than or equal to

>=

Greater than or equal to

Arithmetic Operators

These operators are used to build arithmetic expressions.

Operator

Operation

+

Addition

-

Subtraction

*

Multiplication

/

Division

Logical Operators

These operators are used to combine relational operators to build more complex conditions. The result of the operation of a logical operator is a Boolean value, either true or false.

Operator

Operation

AND

Returns a Boolean value of TRUE only if all the conditions under consideration are satisfied.

Condition 1 AND Condition2

OR

Returns a Boolean value of TRUE if any of the conditions under consideration are satisfied.

Condition 1 OR Condition2

!

The NOT logical operator (!) reverses the true/false outcome of the expression that immediately follows. It is also used to negate logical variables or constants.

! Condition 1

The operands in a Filter can be:

  • Constant values.

  • Variable values ( Variables set at the template level or step level can be referenced ).

  • Object values ( Values of the records in the object can be referenced ).

  • Expressions built using any or all of the above.

Note

Variables set at the Template level or Step level can undergo changes based on the actions performed in the previous Steps.

Using variables enables you to make a dynamic decision based on the value of the variable at the time of executing the Template.

Before using a value, you must specify the data type of the value.

FiltersDataTypeValue.png

The following data types are available:

Data types

Description

VALUE_STRING

Character String Value.

VALUE_NUMERICAL

Numerical Value.

VALUE_LOGICAL

Logical Value.

VALUE_REGEX

Regular Expression - A sequence of characters that specifies a search pattern in text.

VALUE_DATE

Date value.

OBJECT_VALUE

A property of the selected object.

VARIABLE_VALUE

Value of a variable set at the template or step level.

VALUE_LITERAL

System Specific Usage. Not available to use currently.

To set a Filter:

  1. Click Add Filter.

    FilterSetUp1.png
  2. These warnings will persist until the filter is set up accurately.

    FiltersWarnings.png

    Note

    You will see these warnings multiple times during the course of setting up the Filter. They may appear when you change the operands and / or operators.

    They alert you when incompatible operands are used with an operator and ensure that a meaningful Filter is created.

  3. Click 'OP_UNKNOWN'.

    FilterSetUp3Click.png
  4. Choose an operator that suits your requirements. Here, the relational operator Less than is chosen.

    FilterSetUp4SelectOperator.png
    FilterSetUp4SelectOperator2.png
  5. Specify the data type and value of the first operand. Here, the first operand is a property of the object, BatteryVoltage.

    FilterSetUp5Operand1.png
    FilterSetUp5Operand1-choosevalue.png
  6. Specify the data type and value of the second operand. Here, the second operand is a template variable, MaxVoltage.

    FilterSetUp5Operand2.png
    FilterSetUp5Operand2-choosevalue.png

    The filter is set to choose the records that have the value of BatteryVoltage less than the value of the variable MaxVoltage. The dropdown list in the Master Data Selector step will be populated with data from these records.

    FiltersSet.png

Note

Remember to save the template after setting up your filter.

You can build your filter using the operators and operands available in Fieldlogs.

A list of useful filter configurations are presented below. This list is just a sample and is by no means exhaustive.

Filter Structure

Setting Up the Filter

A logical operator with just one operand

FiltersOneOperand.png

If the condition evaluates to true, the Master Data Selector input is populated. Otherwise, it is not populated.

FiltersFLanycondition.png

A logical operator with just one operand

FiltersOneOperand.png

The Master Data Selector input is populated with data that satisfy the condition.

FilterFLoneoperand.png

A comparison operator with two operands

ComparisonOperator.png

The Master Data Selector input is populated with records that satisfy the condition.

comparisonoperator_FL.png

A logical operator with two operands

FilterLogicalOperatorWith2Operands.png

The Master Data Selector input is populated with records that satisfy the conditions 1 and 2.

FiltersFLtwoconditions.png

A logical operator with two operands. Each operand in turn is another expression.

FiltersNested.png

The Master Data Selector input is populated with records that satisfy the either conditions 1 and 2 or conditions 3 and 4.

FiltersFLNested.png

Note

You can use the Execution Preview to test your Filter.

execpreview.png