Group Index

To look up data from the group index:

    group_by(data_source_name: str, index_name: str, query: str) -> Map[]
  • data_source_name is the name you gave your lookup table
  • index_name is the name of the unique index you wish to query
  • query is the value that the index will search for
  • The return value is either a list of Map objects containing the matched rows

A query from our example table from earlier could look like this:

    let values = group_by("products", "tag", "mug");
    /*
        values = [
            #{
                "Product Code": "MUG-001",
                "Tag": "mug",
                "Weight": "300.0",
                "Unit": "g"
            },
            #{
                "Product Code": "MUG-002",
                "Tag": "mug",
                "Weight": "400.0",
                "Unit": "g"
            },
            #{
                "Product Code": "MUG-003",
                "Tag": "mug",
                "Weight": "260.0",
                "Unit": "g"
            }
        ]
    */