New customer? Start here
FieldNames2FieldValues ( Text )
Text - template text with field names
text
Replaces all occurrences like {{<Table Name>::<Field Name>}} to actual field values.
Input:
Output (field names replaced to field values):
Let ([ openMacrosPosition = Position ( Text; "{{" ; 1 ; 1 ); closeMacrosPosition = If (Position ( Text; "}}" ; 1 ; 1 )=0; -2; Position ( Text; "}}" ; 1 ; 1 )); macrosContents = Middle ( Text; openMacrosPosition + 2 ; closeMacrosPosition - openMacrosPosition - 2); replacementText = GetField ( macrosContents ); res = Replace ( Text ; openMacrosPosition ; closeMacrosPosition - openMacrosPosition + 2 ; replacementText ); macroscount = PatternCount ( res ; "{{" ) ]; If ( macroscount=0 ; res; FieldNames2FieldValues (res) ) )