Support Topics Documentation Slack YouTube Blog

Example on how to use the Real-Time API with Codeless

Hi,
I can’T find an example on how to use the Real Time API with Codeless. For example, how can I update a container in real time when the data is updated?

Help anyone?
Thanks in advance.

Hello @KLoic

Just add a subscriber block in the On Page Enter and add logic that runs each when data is changed.

Then, do not forget to unsubscribe when you leave the page

Take a look at this example, you can replace the print blocks with whatever you need

Regards, Vlad

Thanks @vladimir-upirov

Which id should be entered where you’ve entered ‘updatePerson’? the table property ? simply assign a subscription name?

Basically, I have this game leaderboard displayed in a dynamiclist container. And I would like the 4th column (profit) to be sorted in realtime (desc) when the data is updated.

image

Here are my blocks look like. It doesnt work so far. What should I change?

Thanks again

Which id should be entered where you’ve entered ‘updatePerson’? the table property ? simply assign a subscription name?

this is just a reference (id) for removing, it could be any unique string

Well, you have to add logic inside the RT handler that will

  1. find object to update in the LeaderboardContainer items list
  2. update the object with necessary properties (for ex: Rofit)
  3. sort it according to new new values

Hmmm ok ok. Let figure it this. Thanks for the quick reply.