I have a long text field on a saved search that ha...
# suitescript
n
I have a long text field on a saved search that has JSON in it. How can I extract a specific keys value from that field on the search?
c
I personally would alter whatever ingests it, and add that value as a new custom field. you're not going to have fun with saved searches. though you've posted in SuiteScript - are you processing a resultset in a script?
n
basically I am creating custom record entries that have one field that has JSON in it. Then on the saved search of these custom records, i want to pull out each value from JSON field. That way if a new key is added to the json, I don't have to create another field on the custom record @CD
c
sounds like you're going to have fun with the
REGEXP_
functions
n
Yeah tried that but keep getting invalid expression error
I tried this: REGEXP_INSTR({custrecord_nco_fam_reporting_json}, 'test1 : '([^:]*)'')
JSON field:
{test1 : 'test one', test2 : 'test two'}
c
You need to escape the quotes
n
how
not awesome at regex haha
n
@CD just the expression or the part with the regex
e
@Nicholas Williams Check out regex101.com I'm BADDDD at regex took, but that site makes it much easier to guess and check
t
What is your character length on the JSON? Saved searches only return the first so many characters so regexes can still fail to find everything.
n
Figured it out @Travis Zuri and @ericbirdsall thanks for the resource
d
@Travis Zuri I can confirm that fields in
Formula(text)
criteria and results truncate values to 1000 characters