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 - Show more from this author
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.
 
Robert Koszegi   Robert Koszegi, The Media Concierge
Jul 19, 2019
This is a late comment, but this CF is new to me and it has been extremely handy to have. Thank you.
 

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.

Support this website.

This library has been a free commmunity resource for FileMaker users and developers for 20 years. It receives no funding and has no advertisements. If it has helped you out, I'd really appreciate it if you could contribute whatever you think it's worth: