Cannot build redis command with function

I'm building Redis hmget command, using a function below

  1. When using a function, the result is "undefined"

  2. If Copy that function's result, the query has result as shown

I'm using * Retool version 2.100.7, this issue is from several versions before.

UPDATE: I forgot to put my code

{{ (function() {
  if (!textInput1.value) {
  const userIds = _.chain(textInput1.value).split(',')
  .map(e => e.trim()).compact().uniq().value();
  return `hmget myhkey ${userIds.join(' ')}`
})() }}

Hello! Did this query work before with this same syntax?

Before that, I use ternary operator on Redis and it worked.
After that, logics rise, and I prefer wrap it into a function like this one. I use this wrap in many places like mongodb, component logics,... only in Redis query it doesn't work.
Copy the raw result of wrap function to use it as a command => it works, as I shown above.

It seems like the quotation marks/the fact that the code returns a string might be the problem!

This works:

This does not work:

That quotation is Javascript string, and it's not part of the result.
This should be consider as a bug, can you tag one of your tech guy to check it out?

Absolutely! Filed the bug internally, and will post here with any updates :slight_smile:

Hi, any updates on this one. I see retool releases updates regually, but this issue is still there, why?

The issue can be explained as simple as this: Cannot use javascript to build command in Redis resource. Only can use plain text.

Hey @hiep95! Long time no talk :slight_smile:

No updates yet (haven't had any other requests for this feature), but I just bumped the request internally!

1 Like

This bug is still not fixed!
Although Retool supports Redis, but without the ability to write function, all I can do is write a very simple Redis command.

Hi @hiep95! This still hasn't been prioritized, but I added your feedback to the ticket again. I'm sorry this is so blocking for you :frowning: