Bug: Event handler "Row select" with action "Trigger query" is running twice since Event handlers update

Hi everyone :wave:

I'm using a Table component with one event handler: "Row select".
This triggers an action: "Trigger query".

The query is the following:

tabbedcontainer1.selectTab(1);
if (clientsTable.selectedRow.data.calendars) {
  clientsTable.selectedRow.data.calendars.forEach(element => {
    utils.openUrl("https://iplan.to/"+ element.uid + "?sdmn=1")
  });
}

This is the configuration of such event.

image

However, the query is running twice. I can notice this behavior because the url that should be opened in the action, is being opened twice (and I'm sure that the forEach inside the action is working properly).

I've been experimenting changing the params for Debounce, Throttle, especifying different values, but no luck yet.

This was working fine before the event handlers were introduced, so I suppose it may be related to that.

Can anyone please help me? :pray:
What else could I try?

Hi @joel Happy to help! Would you mind also posting a screenshot of the table's selected row data inside the left panel?


Example:

1 Like

Sure, thanks @Tess

Let me know if you need more info :slightly_smiling_face:

Thanks, @joel

Just to confirm, in the current process, is the query opening

https://iplan.to/296122460?sdmn=1  AND https://iplan.to/350725808?sdmn=1

or

https://iplan.to/296122460?sdmn=1 AND https://iplan.to/296122460?sdmn=1  AND https://iplan.to/350725808?sdmn=1 AND https://iplan.to/350725808?sdmn=1
1 Like

The query should open:

https://iplan.to/296122460?sdmn=1 AND https://iplan.to/350725808?sdmn=1

That was the behavior before Event handler update.

But right now, it's doing:

https://iplan.to/296122460?sdmn=1 AND https://iplan.to/296122460?sdmn=1 AND https://iplan.to/350725808?sdmn=1 AND https://iplan.to/350725808?sdmn=1

My guess is that after Event handler update, the query is being triggered twice now.

I just checked editing my JS query, to avoid any for each.

This also results in the url being opened twice.

Thanks for the assistance! Hope we can find a solution soon :slightly_smiling_face:

Hi @joel

Thanks for these details! :thinking: I'm having trouble reproducing this on my end.

Can you check your browser console? You should be able to see the triggered queries + the triggeredById, which should tell us how the query is being triggered a second time


1 Like

Hi @Tess , sorry for my late reply.

This is the console result in Chrome:
image

And same behavior in Firefox:
image

This is the prototype object. Not sure if it's necessary for debugging, but let me know if you need better screenshots.

Finally, these are all the consoles messages, since Retool finishes loading, until I click the row that triggers "goToClient" action (which keeps happening twice).

Thanks!

Hi Joel! Quick question while I get up to speed hereβ€”is there a reason you're triggering a query to open a URL instead of opening the URL directly from the event handler? I still haven't been able to repro double opening, but I will let you know!


1 Like

Hey thanks, yes, the reason is that the query I'm running does two things:

  1. It changes the selected tab in a tabbed container
  2. Open one or more URLs (it's a dynamic query)

Btw, you can check the full query on the beginning of this thread ↑

ALTHOUGH, after reading your question, I've just tried separating this query into two queries, and running each one on two different Event handlers.
image

This seems to fix the running twice issue.

Thanks a lot!

I think it's a workaround, but it solves my issue. I'll mark this as Solved, let me know if you need further info to solve the original problem. But I guess it's not a priority now :slightly_smiling_face:

1 Like