I am using jexl.eval function to evaluate a value as follows-
jexl.eval("dataset[0].data['Entity Name'].toLowerCase().replace(/ /g, '_')",data);
dataset[0].data['Entity Name'] is always a string and is never null, there seems to be some error in jexl.eval, It returns empty string always
I wanted to confirm if toLowerCase() and replace() are supported or not? whether there is some issue in my syntax?
jexl playground for next query
toLowerCase()andreplaceare supported methods for string manipulation but you're using the wrong syntax which may be one of the reasons for unwanted output.In JEXL, you can use the
|(pipe) operator to chain transformations on a value. So, to properly use them, you need to define thee transform functions(fortoLowerCaseandreplace) before using them in your JEXL expression. Something like:JEXL playground