$$tFacility may be text, then you need to quote it.
..." & Quote ( $$tFacility ) & "...
and return null
... & ";\"\")"
returning 0 is easier to write.
... & ";0)"
I missed ] in last 2.
There are a number of ways of passing and evaluating parameters. Some developers at FileMaker Standards web site have a recommendation of how to pass parameters using custom functions and I see it being used more and more lately. You can see their methods at: Custom Functions » Script Parameter Interface - Best Practices - FileMaker Coding Standards
the TEXT values must be quoted
"Let( $abc = \"" & myTEXTfield & "\"; $def = " & myNUMBERfield & " )"
when Evaluated, becomes:
Let( $abc = "qwerty" ; $def = 123 )
It helps to just write the results you expect, and go back and make the quotes correct and the field-name insertions.
But there are other easier way to do this passing, as Taylor noted. And there are others.
Many of us wish for this type of passing to be native (with JSON or other methods). Check the Ideas section in this forum and vote on them!!
Thank you so much for all the help! got it sorted:)
If you use Evaluate(), using Quote() is safer than adding " so that text field value can contain " or line break.
Let ( t = "a¶b";
Evaluate ( "\"" & t & "\"" )
result "a b"