To resolve a data from JavaScript files hosted on nexl server you have to provide an
expression which exactly tells
what you need to resolve from the file.
nexl expressions can be also a part of JavaScript files and they being evaluated on
the fly.
Let's consider an example:
// colors array
colors = ['Red', 'Green', 'Blue'];
// allColors variable is referencing to color array in expression
// this expression sorts colors array (#S) and joins its items with comma (&,)
allColors = '${colors#S&,}';
// [person.favColors] field is referencing to allColors variable
person = {
name: 'John',
favColors: '${allColors}'
};
In this example
person object has a
favColors field which is
referencing
to the
allColors variable.
allColors JavaScript variable is referencing to the
colors array via
nexl
expression. It also sorts
colors
array and joins all array items with comma.
When you reference a
person
object in HTTP request, nexl will calculate all nexl expression references virally.