What’s the proper way to get the values out of the...
# suitescript
z
What’s the proper way to get the values out of the context in a meaningful object? It is returning
Copy code
{
   type: "mapreduce.ReduceContext",
   isRestarted: false,
   executionNo: 1,
   key: "291995",
   values: [
      "{"publicamt":"","roamamt":"550"}",
      "{"publicamt":"115","roamamt":""}"
   ]
}
j
Data passed between mapreduce stages are serialized as strings using JSON.stringify, so you JSON.parse elements of the reduceContext.values array
Copy code
var values = reduceCtx.values.map(JSON.parse);