Refresh Screen Data With External Collection

Hi all,

I have searched high and low and can’t find an answer or tweak to this. Is there a way to refresh data on a screen using Xano or Airtable (External Collections) in the same way as it is possible with Adalo DB (advanced option)?

I would like to move my DB to external, but the ability to refresh data in real-time on an active screen is absolutely necessary.

Thanks.

Maybe @xano @bhanu or @JL_LJ might be able to help. :slight_smile:

@creativechili on screen refresh is not possible both with internal or external collections. The collections are loaded at the time of transition from one screen to the another.

@James_App_Maker thanks for the tag.

1 Like

Hi @bhanu,

Maybe we are not talking about the same thing, but auto refresh is available with internal collections, see below.

Basically I need this same functionality with external collections.

adalo-refresh

Hi all,

As far as I understand how it works…
To start with, let’s separate screen refresh (which can happen only as a result of some action), and list contents refresh.
As I understand @creativechili is talking about refreshing the list contents, when the list is displaying external collection and some new data has been added / existing data altered.

I don’t think that such function exists in Adalo external collections. In order for an Adalo app to know that data in the external collection has been changed, there are 2 possible ways: either Adalo need to send a request to the collection, or collection needs to report the change.

First way may lead to high resource consumption (how often Adalo should send the request? Once per second? Once per 5 seconds? Once per minute? What about external collection API rate limits? What about network/server limits?).

Second way is better from performance point of view, but for this Adalo needs to have some “listener” which listen to the changes, and External collection needs to be able to send requests to this “listener”.
Long story short, based on what I see how External collections work, I don’t think that 2nd way is possible to implement universally for each possible type of collection.

But as I understand the original question was related to an issue something like that: when new data arrives to Xano or Airtable, or data is changed there, these changes need to be reflected in Adalo application with least possible delay and without user interaction.

As for me this could be done by “simulating” the 1st approach from above, i.e. re-sending the request to External Collection. May be this could be done via some tricks of hiding/showing the list (using couple of countdowns), or by sending a user to an empty screen and returning him/her back automatically (again, with countdown timer). These methods might initiate a “refresh” of the external collection list. Though as they are workarounds, they might not be very stable.

Just my 2 cents to share some thoughts.

Best regards, Victor.

1 Like

@Victor You are right on the money there. This is exactly my take on it.

There are scenarios when this is needed. In my case, we have a streaming radio app, so I need to check what song is playing every 5 seconds, and then update the user’s screen with the correct metadata (artist, song, album art). I got it to work great with Adalo internal collection, but it would be even greater if I could move this out to external for several reasons, future performance being one of them.

The best way to solve this would probably be some kind of push via a webhook from the external source, so if Xano or Airtable is updated, their service call a webhook (API) on Adalo to update a particular component or field. To my knowledge, this is not possible with Adalo as of today?

Hi @creativechili,

Ok, thanks for the reply and for providing some more details.
Unfortunately, “backend” capabilities of Adalo are quite limited - it is only a database, file & image storage and notifications API. No webhooks or process logic, unfortunately :frowning:
So, the only way to do it from Adalo side will be polling the collection each X seconds, which is not good in my opinion.

An interesting alternative has come to my mind: in theory, you can create a fields for Artist, Song and URL link to Album art in Users’ collection (anyway you will need to use it - even if you move to external collections, users are stored in Adalo for now and external user auth is still in works).
In these properties you’ll store currently playing song.
So, when song changes, you can somehow update them by some external procedure (say, Integromat) with new values. Not sure they will auto-refresh - may be you need to put them into the single-item list…
To be honest, I’m not sure this is a good solution, just sharing the idea :slight_smile:

Best regards, Victor.

Hi @Victor,

Thanks for your suggestions. As of now, I have a separate table on Adalo with all the metadata stored, and it is updated via PHP and API everytime a new song is played. In turn, Adalo updates the app-screen instantly when the new values are inserted into the database, and it works great. See here: Markup 2021-09-05 at 16.58.03.png - Droplr

My idea was to move this to external at some point, but there is no rush since it IS working perfect at the moment. :slight_smile:

Hi @creativechili,

You’ve already created a good working solution!

So in my personal opinion it doesn’t make sense to move to external collections. They have their downsides as well :slight_smile:

“Don’t fix what is not broken” :slight_smile: :slight_smile: :slight_smile: When you see performance degradation, then it is time for optimisation, IMHO.

Best regards, Victor.

1 Like

Hey @creativechili I’m glad you have things working. Should you ever want to explore this capability with Xano or another Backend in the future, you would use a service like Pusher or Ably which basically uses websockets to update things in realtime from the backend/front-end. As always Thanks also for the clarity and support @Victor and @bhanu !

4 Likes

Hi @Victor,

Just to let you know, I did a test with Airtable, and it DOES update (refresh) the screen in real-time when I make a change to Airtable data. I was sure I tested this before without luck, but I can confirm it works now. I haven’t tested it with @xano yet, but it might work as well.

This is awesome, at least for me. :slight_smile:

@xano Is there a speed or performance comparison between Airtable and Xano? I tried to Google it, but can’t seem to find any review or article about this. Thanks.

Hi @creativechili,

This is quite interesting, as I don’t see the same effect in my test app. When I open the page with Airtable data (via external collection), no matter what I do in Airtable, the data on the page remains the same.
Could you please share your setup?

Best regards, Victor.

Hi @Victor

I noticed this only works with certain components, in this case I use the “Simple List”-component, but it does not work with some of the others. I have not tried them all yet. But here is a screen: Markup 2021-09-15 at 14.53.38.png - Droplr

And on the backend, it looks like this: Markup 2021-09-15 at 14.55.30.png - Droplr

When I make a change in Airtable DB, it is updated immediately on the screen, both on PWA and native app. Pretty cool and I am not sure HOW it works, but it does. :slight_smile:

Hi @creativechili,

Glad it works on your side - I can’t replicate this on my test app :slight_smile:
Does this list updates itself without any user interaction?

Best regards, Victor.

Hello @Victor Super strange then. Yes, in this case I can update the “headline” in the Airtable DB, and the headline on the app updates without any interaction. I was quite surprised to see that this works, since to my knowledge there is no real-time polling either way.

I can create another app and check if it works with that one, will let you know.

Hi @creativechili,

Would be interested to know the results!

Best regards, Victor.