Discussions
Stay up-to-date with the latest news from NetSuite. You’ll be in the know about how to connect with peers and take your business to new heights at our virtual, in-person, on demand events, and much more.
New AI Community Guidelines. Please review and follow them to ensure AI use stays safe, accurate, and compliant.
Parsing JSON returned from nlapiRequestURL
I'm trying to figure out how to parse JSON data returned to a client side script into variables that I can use. Apparently the JSON.parse() command throws an unexpected error (SyntaxError: Unexpected token: n (adhoc$-1$debugger.user#11))
I can see via debugger that my response is good and in the proper format.
var keyword = "xxx";
var url = 'http://someurl.com/search?';
url += 'q=' + encodeURIComponent(keyword);
var response = nlapiRequestURL(url, null, null, null);
var arr = response.getBody();
var address = JSON.parse(response);
0