Get(ScriptParameter)

Returns the script parameter passed into the current script.

Format 

Get ( ScriptParameter )

Parameters 

None

Data type returned 

text

Originated in version 

7.0

Description 

Use this function as part of a calculation evaluated within a script.

Script parameters can be passed into a script via a button, a script trigger, another script, a shortcut (FileMaker Pro in macOS or FileMaker Go), or JavaScript in a web viewer. See the Perform Script script step.

Example 1 

Clears the contents of the field specified in the script parameter and navigates to that field, if you make the field object’s name the same as its field name (see Naming objects). This script can be attached to multiple buttons, each referencing a different field, to clear the contents of multiple fields.

Copy
Set Field By Name [Get ( ScriptParameter ) ; ""]
Go to Object [Object Name: Get ( ScriptParameter )]

Example 2 

Uses the Invoices::Customer Name field as the parameter. Invoices for the current customer are returned in a new window with the Invoice Report layout.

Main script: Current Customer Invoices

Copy
Find Matching Records [Replace; Invoices::Customer ID]
#Calls the View Customer Invoices sub-script, defined below
Perform Script [ Specified: From list ; "View Customer Invoices"; Parameter: Invoices::Customer Name]

Sub-script: View Customer Invoices

Copy
New Window [Name: "Customer: " & Get ( ScriptParameter ); Style: Document]
Go to Layout ["Invoice Report"]
Sort Records [Restore; With dialog: Off]