You can call javascript JS transforms from a DSL rule, but can only get a single string in return
Many people create javascript rules using GUI in OH3. This is a whole new method of working for you to learn. Or javascript rules may used in their own files based version.
Note that OH3 currently supports two different versions of javascript rules
Background -
If you want to stick with DSL, you might be more explicit about what you are trying to achieve. JSONPATH transformation has limitations, some can be worked around. Example