The correct use for you would be to use input data...
# suitescript
n
The correct use for you would be to use input data and just write all the content in to an array and return that array in the end from the function. Skip the map part, you don't really need that. Write the updation part in the reduce as if the reduce function is a foreach loop and the context parameter is having one row of the array you returned from GetInputDataFunction.