Skip to content

mapping.findFirstUsingRight ​

Finds the first mapping row that matches the given right keys. Use it when you expect at most one match. To get every match, use mapping.findUsingRight.

js
mapping.findFirstUsingRight(mappingName, rightKeys)

Parameters ​

ParameterTypeDescription
mappingNamestringThe mapping's name or id.
rightKeysstring[]One element for each dimension on the right side, in order.

Returns ​

string | null

The row as a JSON string, with its id, left keys and right keys. Use JSON.parse() to read it. Returns null when no row matches or the mapping can't be found.

Examples ​

js
const row = JSON.parse(mapping.findFirstUsingRight("Time to Year and Month", ["2017", "Jul"]));
json
{
    "id": 1,
    "left": ["FY2017 - Jul"],
    "right": ["2017", "Jul"]
}