Hi Guys, I'm struggling to get data in Map/Reduce ...
# suitescript
m
Hi Guys, I'm struggling to get data in Map/Reduce Script map function it showing the data when i do a full object but when i m trying to get the value of variable it always return undefined.
e
context.value
is probably a string, not an object. You'll need to
JSON.parse()
it first
t
There are multiple ways to get the data of your context value(s). Maybe the datatype of your return value is not as expected
JSON.parse(context.values[0]).values
JSON.parse(context.value).values
m
@erictgrubaugh Thanks for your response yes you are right it was parse issue when i change the code to JSON.parse it is working fine.
@erictgrubaugh I want to call external API to get item pricing in which stage i need to write the call it is actually in item call i think it will be in map phase