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.
Now is the time to ask your NetSuite-savvy friends and colleagues to join the NetSuite Support Community! Refer now! Click here to watch and learn more!
New AI Community Guidelines. Please review and follow them to ensure AI use stays safe, accurate, and compliant.
Stay in the Know
Be sure you're subscribed to NetSuite communication to stay in the know about monthly happenings, updates and announcements. Subscribe
Be sure you're subscribed to NetSuite communication to stay in the know about monthly happenings, updates and announcements. Subscribe
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