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.
@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.
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.
@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?
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
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
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.
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 !
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.
@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.
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?
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
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.
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.
A somewhat late reply, but I forgot to tell you how it was solved. Basically you add a Adalo database to the list first, then check the “auto refresh”. Then I just change the database collection (I just tried with Xano), and the data will refresh on the screen. I make a change in Xano, and the data on the screen updates instantly.
I am not sure why it works, and it could be a bug. But I guess it opens a websocket and then keeps that even if I switch to an external database.
Perhaps @xano can figure it out. I would love to use it this way, but afraid it will get “corrected” at some point if it is indeed a bug.