Tag Link | [Records_Map] | Category | Results |
---|---|---|---|
Type | Substitution | Source Available | Yes |
Support | Preferred | Version | 8.5 |
Change | New | Data Source | Any |
Output Type | Map | Security | None |
Implementation | Sets | Lasso 8.5 |
[Records_Map] returns a map of maps which contain all of the results from an inline. This tag is comparable to the [Records_Array] tag, but makes it easier to extract records based on their key field value or field names.
For example, results from the [Records_Map] tag for a Contacts.People table might be represented as follows. The keys for the outer map are the key field values for each record from the table. The keys for the inner map are the field names for each record in the found set.
[Map: '1' = (Map: 'First'='John', 'Last'='Doe', 'Age'='25'),
'2' = (Map: 'First'='Jane', 'Last'='Doe', 'Age'='26')]
By default the current key field name is used to determine the key field values. If a
The fields in the [Records_Map] can be pared down using
The field names for the [Records_Map] are drawn from the values returned by the [Field_Names] tag. Alternate field names can be used by specifying a
The order of records is not normally preserved by the [Records_Map] tag since the order of elements in a map is not defined. If the order of records is important then
[Inline:
[Records_Map]
[/Inline]
[Inline:
[Records_Map:
[/Inline]
[Inline:
[Records_Map:
[/Inline]
[Inline:
[Records_Map:
[/Inline]
[Inline:
[Records_Map:
[/Inline]
Optional Parameters | |
---|---|
-KeyField | The name of the field to use as the key for the outer map. Defaults to the current [KeyField_Name], "ID", or the first field of the database results. |
-ReturnField | Specifies a field name that should be included in the inner map. Should be called multiple times to include multiple fields. If no |
-ExcludeField | The name of a field to exclude from the inner map. If no |
-Fields | An array of field names to use for the inner map. By default the value for [Field_Names] will be used. |
-Type | By default the tag returns a map of maps. By specifying |
See the Lasso 8 Language Guide for examples of how to use this tag.