loadListKeyValue()

The loadListKeyValue() function (client-side) retrieves a specific row from a static or CSV table by matching a column value. For more information about static and CSV tables, see Creating Static Tables and Creating CSV Tables.

Syntax

Use this syntax for the loadListKeyValue() function:

            loadListKeyValue('TABLE_CODE', 'ColumnName', 'Value'); 

          

Return Value

The loadListKeyValue() function returns the matching row as an array. The returned array has following structure:

            [
    {
        "ColumnName1": "Value1",
        "ColumnName2": "Value2",
        "ColumnName3": "Value3"
    }
] 

          

Parameters

Note:

All parameters are required.

The loadListKeyValue() function accepts the following parameters:

  • TABLE_CODE - Specifies the code of the table to search. You can find it in the Code field on the table record.

  • ColumnName - Specifies the column name to match against.

  • Value - Defines the value to search for in the specified column.

Examples

The following examples show how to use the loadListKeyValue() function.

Retrieving a Row Matching a Value

This example retrieves a row in which a column contains the provided value. The loadListKeyValue() function searches the table with the ACCESSORIES_TABLE code, checks the Accessory Code column, and returns the row in which the column value matches Lamp-A110.

              loadListKeyValue('ACCESSORIES_TABLE', 'Accessory Code', 'Lamp-A110'); 

            

The function returns the matching row as an array. The resulting output may look like this:

              [
    {
        "Accessory Code": "Lamp-A110",
        "Type": "Lamp",
        "Color": "Blue"
    }
] 

            

Related Topics

General Notices