Hey y’all, just started experimenting with Retool and am loving it. I’m testing it out by rendering a Mapbox map of saved locations, as a replacement for Google My Maps (which is lacking in a lot ways…).
This isn’t particularly high priority, but as a QOL improvement, is it possible to conditionally specify the marker instead of just supplying a single static marker?
In my case, I’m supplying data following this format: { latitude, longitude, type, ... }
And I roughly imagined that I could supply a JS function like so:
Or alternatively, this function could be executed as a Transformer on the Query itself and the marker value stored as a column. In that case, being able to specify a column name would work perfectly.
Hey @colin, and welcome to the community! You can write JS anywhere in Retool, so in the Latitude / Longitude form fields in the Mapbox settings, you can write {{ any JS here }} to dynamically set those values. A common pattern is to use ternary operators (?) in there. You can also use a JS function (create a new query and choose “run JS code”) and reference the .data property of that function if you have more complex logic. Does that make sense / help?