Skip to main content

Monday.listen("events", callback) problem

  • March 16, 2023
  • 6 replies
  • 457 views

Got a problem based on that part of the documentation monday.listen

I try to get information about changes I make via openItemCard and get no response, no console.log. Can someone show me working sample how to use that listener?

6 replies

Matias.Monday
Forum|alt.badge.img
  • monday.com Team Member
  • March 16, 2023

Hello there @mpsujek,

Could you please share the full monday.listen action you are using and what changes you are performing that are not being “listened to”?


  • Author
  • Participating Frequently
  • March 16, 2023

I’m trying to get any response from monday.listen(“events”,…
I did it like this

  useEffect(() => {
    const callback = (res) => console.log(res);
    const unsubscribe = monday.listen("events", callback);
  }, []);

I got that working but now I’m not sure what I’m doing wrong.


  • Author
  • Participating Frequently
  • March 17, 2023

Ok more information about that, I have that listener

useEffect(() => {
    const callback = (res) => console.log(res);
    const unsubscribe = monday.listen("events", callback);
    return () => unsubscribe();
  }, []);

And when I’m on development setup that doesn’t work. Seems there is some issue with the tunnel or with running the app build in that view.
But when I install the app on my board I’ts works as it should.


Matias.Monday
Forum|alt.badge.img
  • monday.com Team Member
  • March 19, 2023

Hello again @mpsujek,

Are you referring to the “preview” section in your app’s feature configuration page?

If so, have you added boards to be connected to the view?


  • Author
  • Participating Frequently
  • March 20, 2023

Yes I’ve added that to board but its not easy to debugging my app In that way.


Matias.Monday
Forum|alt.badge.img
  • monday.com Team Member
  • March 20, 2023

Hello again,

For monday.listen to work, you need to run it with a context present.

That is why you would need for the view to be “connected” to a board.

If I understand correctly, this does work when you use it in an actual board. Correct?

In that case, that is the way you have to test this.

Let me know if you have any questions!

Cheers,
Matias