Skip to content

mapping.findUsingLeft

Returns the definition for a row of the mapping table as a String of JSON Data.

js
mapping.findUsingLeft(mappingName, leftKeys);
mapping.findUsingLeft(mappingName, leftKeys);

Parameters

  • mappingName - An identifier used to find the target mapping.
  • rightKeys - An Array of strings representing elements from each of the mapping dimensions on the right side of the mapping table in order.

Example

js
let row = JSON.parse(mapping.findUsingLeft("Time to Year and Month", ["FY2017 - Jul"]));
console.log(row);
let row = JSON.parse(mapping.findUsingLeft("Time to Year and Month", ["FY2017 - Jul"]));
console.log(row);

This returns a row mapping (if it exists) with the left keys being equal to the FY2017 - Jul element form the Time dimension. The resulting output could appear as follows:

json
{
    "id": 1,
    "left": [
        "FY2017 - Jul"
    ],
    "right": [
        "2017",
        "Jul"
    ]
}
{
    "id": 1,
    "left": [
        "FY2017 - Jul"
    ],
    "right": [
        "2017",
        "Jul"
    ]
}