Reference > Script steps reference > Fields script steps > Insert Current User Name
 
Insert Current User Name
Purpose 
Pastes the current user name into a field in the current record or into a variable.
See also 
Format 
Insert Current User Name [Select; <table::field or variable>]
Options 
Select entire contents replaces the contents of a field or variable. If you don’t select this option:
For a field, replaces only the selected portion of the active field, or inserts data at the insertion point. The default insertion point is at the end of the field's data.
For a variable that doesn’t have container data, inserts data at the end of the variable’s current value. For a variable that has container data, replaces the contents of the variable.
Target specifies the field to paste into or the variable to set. If the variable doesn’t exist, this script step creates it (see Using variables).
Compatibility 
 
Where the script step runs 
Supported 
FileMaker Pro 
Yes 
FileMaker Server 
Yes 
FileMaker Go 
Yes 
Custom Web Publishing 
Yes 
FileMaker WebDirect 
Yes 
Runtime solution 
Yes 
Originated in 
FileMaker Pro 6.0 or earlier
Description 
You must specify a target variable, specify a target field on the current layout, click in a field, or use the Go to Field script step before performing this script step. If Target is not specified, the data is placed in the active field. Otherwise, this script step returns an error code that can be captured with the Get(LastError) function.
The user name is the user-specified name displayed on the General tab of the Preferences dialog box in FileMaker Pro or for FileMaker Go, the user-specified device name in iOS. To track user access to a database with more security, use the Get(AccountName) function to return the current user’s account name.
In FileMaker WebDirect, Insert Current User Name pastes the current user’s account name, not the current user name.
Notes 
If you manually select field data before you run this script step in FileMaker WebDirect, the script step performs as if you did not make a selection. To select field data before you run this script step in FileMaker WebDirect, use the Set Selection script step.
Example 1 
Goes to the Email History layout, inserts the current user name in the Sent by field, then goes to the original layout.
Go to Layout ["Email History"]
Insert Current User Name [Select; Emails::Sent by]
Go to Layout [original layout]
Related topics 
Set Field script step
Script steps reference (alphabetical list)
Script steps reference (category list)