Here is something I have written for you to pull the rendered text values for binary and multistate points.
Now you can use the created object to "map" your current values to their rendered text equivalents...
If you don't understand how this works, feel free to yell out.
var rql="or(";
var items=[]
//Get all points attached to the script context
for(var i in CONTEXT_POINTS)
{
items.push('eq(xid,'+this[ i].getDataPointWrapper().xid+')');
}
//Build RQL query
rql+=items.join(',') + ')';
//get configs of all of these points
var dataPoints=JSON.parse(JsonEmport.dataPointQuery(rql)).dataPoints;
var ptMap={};
//Iterate through to get the rendered values
for(var i=0;i<dataPoints.length;i++)
{
ptMap[ dataPoints[ i ].xid ] = {};
if(dataPoints[i ].textRenderer.type==="BINARY")
{
//Set Binary renderedValues
ptMap[ dataPoints[ i].xid ][0] = dataPoints[ i].textRenderer.zeroLabel;
ptMap[ dataPoints[i ].xid ][1] = dataPoints[i ].textRenderer.oneLabel;
}
else if(dataPoints[i ].textRenderer.type==="MULTISTATE")
{
//Or get the multistate values
for(var j=0;j<dataPoints[i ].textRenderer.multistateValues.length;j++)
{
ptMap[ dataPoints[i ].xid ][dataPoints[ i].textRenderer.multistateValues[j].key] = dataPoints[ i].textRenderer.multistateValues[j].text;
}
}
}
//Print here just to show format of mapping. Can comment out.
print(JSON.stringify(ptMap) ); //so ptMap[xid][ ptValue ] => renderedValue
Fox