LassoScript Utility
Basics Browse Detail


Tag Link [Field] Category Database
Type Substitution Source Available No
Support Preferred Version 2.0
Change Unchanged Data Source Any
Output Type String or Bytes Security None
Implementation LCAPI Sets Lasso 8.5, Lasso 8.0, Lasso 7.0, Lasso 6.0, Lasso 5.0, Lasso 3.x, Lasso 2.5, Lasso 2.0, Lasso 1.x


[Field] returns the value for a field from the current database search. This tag can be used within [Inline] ... [/Inline] tags that return a database found set or in the response page for a Classic Lasso database action that returns a found set.

The name of the field specified in the [Field] tag must be defined in the current found set. If it is not then a syntax error will be reported.

Normally, the [Field] tag is used within [Records] ... [/Records] tags to return the field value from each record in the found set. It can also be used outside of [Records] ... [/Records] tags to return the field value from the first record in the found set (useful if there is only one record in the found set).

The -RecordIndex tag can be used to return a field from a particular record in the current found set without using [Records] ... [/Records] tags to loop through all records.

For FileMaker Pro databases, related field values can be returned by specifying the name of the relation followed by two colons and the name of the field, e.g. relation::fieldname. The related field value must be included in the current layout.

By using the [Portal] ... [/Portal] tags each row in a portal on the current layout can be returned in turn. The -PortalIndex can be used to return a field from a particular row in a portal on the current layout without using the [Portal] ... [/Portal] tags to loop through all rows of a portal.


[Field: 'Field_Name']

  [Field: 'Field_Name']

[Records: -InlineName='Inline_Name']
  [Field: 'Field_Name']

[Field: 'Field_Name', -RecordIndex=Record_Index]

[Field: 'Relation_Name::Field_Name']

[Portal: 'Relation_Name']
  [Field: 'Relation_Name::Field_Name']

[Field: 'Relation_Name::Field_Name', -PortalIndex=Portal_Index]


Required Parameters
Field_Name The name of the field whose value should be returned.
Optional Parameters
-RecordIndex If specified, the value for the field from the specified record from the current found set is returned.
-PortalIndex Can be used for fields which are included in a portal in the current layout in a FileMaker Pro database. The value for the specified field from this row of the portal is returned.
Encoding Keyword Specifies the encoding for the tag's return value. Tags are encoded using -EncodeHTML by default if their value is output on a format file. No encoding is applied to nested tags unless an explicity encoding keyword is specified. One of -EncodeBreak, -EncodeHTML, -EncodeNone, -EncodeRaw, -EncodeSmart, -EncodeStrictURL, -EncodeURL, -EncodeXML.
-RecordID This keyword can be used only with FileMaker data sources. If specified with a related field name (database::fieldname) then the record ID of the related record will be returned rather than the field value.


To return field values from a search:

Use a [Field] tag for each field within [Records] ... [/Records] tag. The following example finds all records in the People table of the Contacts database and returns the First_Name and Last_Name fields for each record in the found set.

[Inline: -Database='Contacts',
    <br>[Field: 'First_Name'] [Field: 'Last_Name']

<br>John Doe
<br>Jane Doe
<br>John Surname
<br>Betty Lastname