Brian Dunning's FileMaker Custom Functions

GetParameter ( ParameterName )

Recall one of multiple parameters passed to a script by the name you assigned that parameter

  Average rating: 4.6 (33 votes) Log in to vote

Daniel Kaan   Daniel Kaan
Data Organisation Pty Ltd
http://www.dataorganisation.com.au

Share on Facebook Share on Twitter

  Sample input:
GetParameter ( "FirstName" )
  Sample output:
Daniel

  Function definition: (Copy & paste into FileMaker's Edit Custom Function window)

This custom function "GetParameter ( ParameterName )" is used to unpack a single named parameter from a list passed to the current script as a script parameter.

The script parameter should be a return delimited list of the form:
ParameterName1=Value1
ParameterName2=Value2
...

For example the following list might be passed as a Script Parameter as follows
Perform Script ( "Create Contact" ; Parameter: ""FirstName=Daniel¶LastName=Kaan"" )

In the "Create Contact" script, the multiple parameters that were passed can now be referened by name
Go to Layout ("Contacts")
New Record/Request
Set Field ( Contacts::First Name ; GetParameter ( "FirstName" ) )
Set Field ( Contacts::Last Name ; GetParameter ( "LastName" ) )

If a parameter is called for that was not passed (eg: GetParameter ( "ShoeSize" ), an empty string is returned.

Because ¶ characters are used to delimit parameters, values containing ¶ characters are returned only with the characters up to, but not inclucing the first ¶ character.

 

Comments

Will Loving   Will Loving, Dedication Technologies, Inc.
Mar 29, 2010
I also use a variation on this function called GetResultParameter() which is identical except that it substitutes Get(ScriptResult) for Get(ScriptParameter) . This allows you to use the same concept for unpacking pass script result parameters.
 

Log in to post comments.

 

Note: these functions are not guaranteed or supported by BrianDunning.com. Please contact the individual developer with any questions or problems.

Under construction. Email me your wish list for improvements.