Is this me being bad at javascript or retool being weird?

Hi! I am trying to write the following in a transformer
letbody = {{text_body.value}}; let first_name = {{familiesSEARCH.data.first_name[0]}}; let user_id = {{familiesSEARCH.data.user_id[0]}}; let token = {{familiesSEARCH.data.token[0]}}; var greeting = () => {{greeting.value}} ? {{greeting.value}} + " " + first_name : ""; let magic_link_string = () => {{magic_link.value}} ?https://orders.trylemontree.com/auth?user=${user_id}&token=${token}` : “”;

return ${greeting}${body}${magic_link_string}
output:
() => **var4 ? **var5 + " " + first_name : ""thing() => ___var6 ? https://orders.trylemontree.com/auth?user=${user_id}&token=${token} : “”
BUT for some reason, it’s treating the output as objects. am I doing something wrong?

hi @alex-godin! sorry im a bit confused, is this the output you wanted? greeting and magic_link_string are functions, but you never call them

when you say “it’s treating the output as objects”, what do you mean? do you mean that when you save this transformer, retool computes the transformer’s value to be an object, instead of a string? if so, what does that object look like?

this is why I shouldn’t be allowed to write javascript!

i was just printing the function rather than calling it!

I needed to add parens!

hahaha got it! glad you figured it out :slight_smile: