mapping.findUsingRight
Finds the mapping rows that match the given right keys.
js
mapping.findUsingRight(mappingName, rightKeys)Parameters
| Parameter | Type | Description |
|---|---|---|
mappingName | string | The mapping's name or id. |
rightKeys | string[] | One element for each dimension on the right side, in order. |
Returns
string | nullThe matching rows as a JSON string, read with JSON.parse(). It's always an array, even when only one row matches, and each row has its id, left keys and right keys. Returns null when no row matches. To get a single row instead, use mapping.findFirstUsingRight.
Examples
js
const rows = JSON.parse(mapping.findUsingRight("Time to Year and Month", ["2017", "Jul"]));
console.log(rows);json
[
{
"id": 1,
"left": ["FY2017 - Jul"],
"right": ["2017", "Jul"]
}
]