Dynamic debounce value via transformer in event handler shows error despite working

I'm attempting to use a transformer to provide a constant value of milliseconds that I can reuse as the debounce value across various event handlers (for DRY reasons).

What's surprising is that Retool is highlighting the name of the transformer and saying it is not defined, yet the preview of the accessed value is accurate. It even works in practice just the same as if I'd used a literal value for debounce.

(I see the same results when using a temporary state variable.)

Screen Shot 2022-10-06 at 8.25.14 PM

Hey @dguzzo

This looks buggy, thanks for surfacing it! Does the debounce work properly on the event handler despite the red underline? This seems to be the case with some testing on my end and am curious if it's so for you as well.

Sure thing, thanks for the quick response, Kabirdas!

It does indeed still work despite the red; that is what I meant by this comment:

It even works in practice just the same as if I'd used a literal value for debounce.

But I'm happy to clarify or provide additional details if needed.

1 Like

Side note: even when I used the forum's "Reply" feature, it never seems like it's threading the replies. It'll show the user I'm replying to in the actual reply form, but after I post it it just seems inline like a new comment not addressed to anyone in particular. /shrug/

Anyway, here's a mention just in case you wouldn't have gotten a notification above, @Kabirdas :slight_smile:

Ahh got it. No need for additional details, will go ahead and let our dev team know and report back here when there's a fix :slightly_smiling_face:

1 Like

Hey, I think I'm having this problem.

  1. I'm populating a table using an API resource.
  2. I'm using a transformer to run JS on two columns, to return an array that I'm passing to a custom column.
  3. The JS transformer works fine, it returns the expected results when I hit 'preview' AND shows them in the custom column
  4. BUT the whole table is marked red


What's going on here?

OK - I think I figured it out.

I think there were "circular dependencies" that came from the fact that I was referencing the table in the transformer, and then using the transformer to update the table.

When I switched to referencing the underlying resource query (that populates the table) instead, the issue went away.

I thought this would be OK because they weren't "really" circular - but I think it was enough to cause a problem.

Here's roughly how it was working:

  1. table1 gets data from query1 - has two columns, 1 and 2
  2. transformer1 creates an array from table1.col1 and table1.col2
  3. a custom column (column 3) in table1 uses transformer1 - so table1 depends on table1

I can see why this might be considered circular, even though, like, iterative calculations would solve it.