Hey All: Looking to pass a json payload from a RES...
# integrations
a
Hey All: Looking to pass a json payload from a RESTlet POST request to a Map/Reduce Script. However, it doesn't seem to be working. Is there any documentation or examples of this type of functionality?
n
You would typically pass data to the map/reduce using a parameter. Define a parameter on the map/reduce. Use the N/task module to invoke the map/reduce and add the parameter key:value pair.
Copy code
let mrTask = task.create({ taskType: task.TaskType.MAP_REDUCE });
    mrTask.scriptId = 1210;
    mrTask.params = { custscript_lines_obj: linesObj };
    mrTaskId = mrTask.submit();