I'm trying to use the tag component and loading it via a JSON Query via SQL where I'm pulling a list of labels.
You'll see I have in the tags. I have tried a number of different combinations and feeling stuck:
[{{forecast_sql_labels.data}}]
You'll see after I hover over, I see the that there are three elements. I'm just not sure where to go from here to show this in an array so the tags work.
You don't need the [] brackets since the output is already an array.
As for the other two requests, you can use regex string manipulation on javascript to do the replacing, i.e.
You can either do the transformation on forecast_sql_labels query or directly on that {{}} for the tags data.
EDIT: Just plain string manipulation. There's no need for regex here as the first word and underscore are pretty static so just a straightforward replace function needed.
Thank you for the prompt response. I may be bordering on idiot. I copied directly and pasted each of these individually to try and well, neither worked for me.
I'm assuming x => x.name should be used with something different?
Ahhh, sorry, @bsteiger, I didn't expect replaceAll wouldn't be a function available for retool. Replace replaceAll with just replace and that should work.
@bsteiger it's a javascript function to help you transform/process your iterables (array/list), which in this case your forecast_sql_labels. Map function returns an array.
x being the parameter for the function (indicative of this => symbol) on how we are gonna do the transformation.
x.name is the way to access the example you have, e.g. "Skill_Account_Management", etc.
.replace(textBeingReplaced, textToReplace) as the name of the function itself, you change the value of the first parameter (textBeingReplaced) with the value of the second parameter (textToReplace).
Despite Retool being a low-code internal tool builder, I'd say there's a fair amount of programming knowledge required to navigate it. Hope my explanation made sense to you.