<@UK2MLQE4B> NetSuite provides XML parsing API in ...
# suitescript
j
@Php NetSuite provides XML parsing API in SS 2.0 and 1.0, but there's no take this XML and give me an associated array in one line you'd have to build it making queries on the document..Perhaps there's javascript lib out there to make it easier.
p
can we use external libs in suitescript?
j
Yes I have been able to use some (like lodash) and had trouble with others. Not a JS Guru, so don't feel right speaking to requirements of an external lib to work in NetSuite.
Lots of great people here that can help though
p
thanks
t
I haven't used this myself, but I know other NS devs that have had success with it: https://github.com/abdmob/x2js
m
I’m still primarily using SS1 and I will generally look for libraries that are vanilla JS (or transpiled to ES5 with polyfills if necessary) and no dependencies to load through the External Libraries section of a Script Record. I can then access their objects and functions in the main script file.
I had a stroke of good luck with a UUID generator I had been searching high and low for.
p
@tdietrich I used this one but i'm getting error, is it compatible with ss1 or ss2?
t
I believe it's SS2 compatible. I haven't used it myself.