I do a lot of templating for my app, and not having JavaScript's template literals feature (https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Template_literals ) is a huge pain. For example, formatting an address for me looks like this:
address.streetAddress +
(address.line2 ? ' ' + address.line2 : '') +
', ' + address.city +
', ' + address.state +
' ' + address.zip
When it could look like:
`${address.streetAddress}${address.line2 ? ` ${address.line2} : ''}, ${address.city}, ${address.state} ${address.zip}`;
Hi @danrschlosser ! It looks like this works in a JS query, but perhaps not everywhere. Where are you writing your address formatting code?
Transformers and in the value for a text input is most common for me! I usually am doing templating when building a string to show a user, which is usually not in JS queries unfortunately.
Noted! Thank you for writing in with this request 🙏
hanni
April 1, 2022, 1:43am
#5
Any update on support for template literals within transformers?
Hey @hanni ! I just went to test and it looks like it's working for me in a JS transformer! How do things look on your end?
hanni
April 1, 2022, 3:14pm
#7
Thanks, looks like I just needed to add the spaces in there between the template variable brackets and retool variable brackets.