GetAsTemplateLiteral ( fieldName )
Return the field - whose name contains reserved characters and/or symbols - as a template literal which can be used to retrieve the field value.
Be the first to rate this function Log in to vote
Marcus Nilsson - Show more from this author
Square Moon https://www.squaremoon.se/ |
Function definition: (Copy & paste into FileMaker's Edit Custom Function window)
/**
* ==================================================================
* GetAsTemplateLiteral ( fieldName )
*
* PARAMETERS:
* @fieldName (text) Text value
* RETURNS:
* (text) The field name as a template literal
* EXAMPLE:
* "GetAsTemplateLiteral ( GetFieldName ( Table::${A + B} )" returns "Table::${A + B}" which can be used to retrieve the field value using "Evaluate ( expression )" or "GetField ( fieldName )", unlike "Table::A + B" which is returned by default.
* DEPENDENCIES:
* None
* AUTHOR:
* Marcus Nilsson, Square Moon Industries AB, marcus@squaremoon.se
* PURPOSE:
* Return the field - whose name contains reserved characters and/or symbols - as a template literal which can be used to retrieve the field value.
* NOTES:
* For more information, read the article "Using a reserved word or symbol for a field or table name" @ https://fmhelp.filemaker.com/help/18/fmp/en/index.html#page/FMP_Help%2Freserved-word-symbol-for-field-or-table.html%23ww1030956
* REVISIONS:
* 2020-06-05, Marcus Nilsson. Created.
* ==================================================================
*
*/
Replace ( fieldName ; Position ( fieldName ; "::" ; 1 ; 1 ) ; 2 ; "::${" ) & "}"
Comments
Note: these functions are not guaranteed or supported by BrianDunning.com. Please contact the individual developer with any questions or problems.