Logical functions

Logical functions test for a condition to evaluate it as true or false. This is known as a Boolean value. If the condition is true, FileMaker Pro returns a 1; if the condition is false, FileMaker Pro returns a 0. You can use the keywords True and False with logical functions and operators when a Boolean value is needed. Keyword True returns 1 and keyword False returns 0.

Logical functions can also evaluate parameters such as text or arithmetic operations that do not make a true or false statement, or in the case of the GetField function, return the contents of another field.

Function

Purpose

Case

Returns one of several possible results based on a series of tests.

Choose

Returns one result value, according to the integer value of a test.

Evaluate

Evaluates an expression as a calculation.

EvaluationError

Returns an error code, if any, from an expression.

ExecuteSQL

Executes an SQL query statement for the specified table occurrence in a FileMaker Pro file.

ExecuteSQLe

Executes an SQL query statement for the specified table occurrence in a FileMaker Pro file and, if an error occurs, returns ? followed by an error message.

GetAsBoolean

Returns 1 (true) if data converts to a non-zero numeric value or a container field holds data; otherwise, returns 0 (false).

GetField

Evaluates fieldName and returns the contents of the specified field.

GetNthRecord

Returns the contents of a field from the specified record number.

GetSummary

Returns the value of summaryField for the current range of records when the file is sorted by breakField.

If

Returns result1 if the test is true; returns result2 if the test is false.

IsEmpty

Returns 1 (true) if a field is empty or if other errors occur; otherwise, returns 0 (false).

IsValid

Returns 0 (false) if the data is invalid; otherwise, returns 1 (true).

IsValidExpression

Returns 1 (true) if an expression syntax is correct; otherwise, returns 0 (false).

Let

Sets a variable or variables to the result of the specified expression(s) for the duration of the calculation, or until the script exits or the file is closed.

Lookup

Returns the value specified in sourceField, using the relationships in the relationships graph.

LookupNext

Returns the next lower or higher value in sourceField when there isn't a matching related value.

Self

Returns the content of the object in which the calculation is defined.

SetRecursion

Sets the maximum number of iterations for recursion and loops within an expression.

While

Repeats logic while the condition is true, then returns the result.