If I have a field on a record that is a text field...
# suitescript
a
If I have a field on a record that is a text field, which is really used as as comma delimitted field. Is there a way in a search filter to split by the delimiter and get the if the results match a certain text? I could just get all results and than in javascript, filter where theField.split(',').includes('searchVal') but I think it will much more performative if I can add this to a search filter rather than get all the results.
m
If you use the formula filter you can probably use 'contains' and then search for the value
a
My question is how I can do a delimiter splitting in a formula. But also I want an exact match for any of the delimmted options
m
If i think about it an exact match can be (equals 'value' OR contains ',value' OR contains 'value,' OR contains ',value,'). This would find it in the beginning, end and middle of the list or when there is only 1 value.
However i dont think you can extract the value from the list using netsuites search. You get the whole csv and then split and take what you need
a
Okay. Thanks
d
^^ one trick with handling the
value
value,
,value,
value,
issue is to just add the delimiter (comma) to both the start and end, and search for
,value,
This also solves the issue of looking for
234
in
abc,12345,xyz
. You'd correctly not get a match searching for
,234,
in
,abc,12345,xyz,