Auto update content every x seconds

Our app will make extensive use of a custom API. We have a radio station and I need to query every 30 seconds or so what’s on now. Is anything like this possible? If I have to, I could use a web view, but I’d rather not because I want to be able to click the current show and go to it’s details page.

Hi @ncmarc and welcome to the forum :wave:

Yes, this is possible but I would double-check first with @David for the max call rate/hour as this is a new feature and they haven’t fully updated the documentation yet.

https://help.adalo.com/integrations/the-adalo-api

This is completely within the rate limits. :slight_smile:

My advice here is you could make a new collection for this, call it “current show”. Then every 30 seconds create a new record using the collections API of Adalo in that collection from the response from your API.

Now, create a list. Sort this list by “Created date - newest to oldest”. Set the maximum number of results to 1. Then in advanced settings, make sure to enable the autorefresh option.

This list will now automatically update with the latest show info from your API. :slight_smile:

2 Likes

Instead of inserting a record, seems like it would be better to just update the record? Otherwise there would be 10’s of 1000s in there in no time. Does anyone have docs on how to do this? The API docs only talk about push notifications.

This would be better, you’re right. Then also need to change the sorting of the list to “last updated - newest to oldest”

@Colin can you tell me how to use the database api? where is the docs/endpoints?

EDIT: Nevermind, I found the info.

@ncmarc If you have the time, would love to hear how you solved this. I have a Questions collection, and I need to query a property in the collection every 24 hours to find out if the question has been answered and the property has toggled over to “answered”. If still unanswered, I need to automate an email and a push notification.

Not exactly what you are trying to accomplish, but similar enough. Perhaps I can try following the same steps as you…thanks in advance!

I would use Zapier to automate a push notification. There’s a great tutorial about something close to that for scheduled notifications, but it’s very similar. Of course if you are good with PHP you could do a cron job to connect to the collection API and query it then connect to the push notification API to send out the notification. Zapier just makes it more easy and visual.

To find out how to connect to the collection API, here’s the video I am working with:

1 Like

Watched the video a few times but still can’t wrap my brain around the specific steps :frowning: I’ll keep plugging away and thanks for the quick reply

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.