fm_evaluate


mixed fm_evaluate ( string $expression )



Description


Evaluates expression using FileMaker’s calculation engine.

 

Parameters


expression (required)

Any expression that can be used with FileMaker’s Evaluate function.

 

Return


Returns the result from FileMaker, converted to the matching PHP type as follows:

FileMaker TypePHP TypeNotes
textstring 
numberdoubleBoth integer and decimal numbers are converted to double. Note that decimal values are rounded to 13 places, for example, if you evaluate Pi as the expression, the returned value will be 3.1415926535898 (13 places), however, if you evaluate Pi directly with FileMaker, the returned value will be 3.1415926535897932 (16 places).
datestringA date string formatted using the SQL 92 syntax: YYYY-MM-DD.
timestringA time string formatted using the SQL 92 syntax: HH:MM:SS or HH:MM:SS.UUU if the value is stored with microtime values.
timestampstringA timestamp string formatted using the SQL 92 syntax: YYYY-MM-DD HH:MM:SS or YYYY-MM-DD HH:MM:SS.UUU if the value is stored with microtime values.
container (stored)arraySpecial PHP container array that allows you to access container data within PHP.
container (referenced or remote)stringThe name and path of the file.

 

Errors


Will return ? if the expression is not valid.

 

Example 1 - Get application version
echo fm_evaluate('Get ( ApplicationVersion )');
/*
Returns: ProAdvanced 14.0.2
*/

Change Log

VersionDescription
3.0.0Function now supports containers and returns mixed instead of string. Return values are converted to the matching PHP type.