In the reduce stage of a MR script, how do I get t...
# suitescript
r
In the reduce stage of a MR script, how do I get the value (which is summarized) of, for example, of field 1 and field 2 in the following object that I get in the reduce stage to process?
Copy code
{
  "recordType": null,
  "id": "1",
  "values": {
    "GROUP(field1)": {
      "value": "123",
      "text": "Test123"
    },
    "SUM(field2)": "43.00"
  }
}
s
try
object.values["SUM(field2)"]
r
Yes, just did, that does the trick, I was getting confused. Thanks!
s
I'd recommend a different label that doesn't include special characters
r
By special characters you mean the ( ), right?
s
Yea, I'd try to give that entire
SUM(field2)
a friendlier/meaningful name, same with
GROUP(xxx)
👍 1