Real time fetch of remote data to power lists and charts

Hi,

A newbie here so please bear with me.

I have a scenario where I need to fetch a list from remote API server and use the list to display a list of menu items. Furthermore, whenever the user navigates to that page in the app, the API has to be reissued and fresh list of menu items need to be fetched and displayed. IOW, I would like to modify that list in my backend and the front end should reflect it without any manual import process. I would also like a similar kind of API fetch to power my graphs and charts since I am collecting statistics that I keep in my backend sql tables. Same refresh strategy applies to my charts as well - i.e. when the user navigates to the chart screen, I would like the API to be reissued to my backend since the data keeps changing there. Was wondering what is the best way to accomplish this?

I know Glide has data fetch constructs for remote fetching JSON payload and JQ for transformation. But these seem to be pretty static and API fetch and importing is not triggered by user navigation to a screen. I need this to happen in real time (during navigation to screen) and moreover I need the returned results to be treated as “columns” to directly power the front end menu items and charts/graphs. Its even better if I am able to completely skip storing this remote data into tables as I always would like to fetch the data from my API server and not cache anything locally (data keeps changing in my use case).

Thanks much.
Resh

Can someone help with this query or is Glide not suited for these types of apps where data usually comes from real database-backed systems rather than glide tables or google sheets?

Hola,

yes, it is doable with Glide, I guess you need something like this A Google Sheet working as a REST API: good or bad idea? đź’Ł

Wow, that’s quite a cumbersome way of integrating with database backends. It also looks like the results cannot be used as first-class table/columns. I am surprised that this is not an often used feature, especially for those building database-backed apps (most serious apps IMO). I started looking at alternatives to Glide and I found a platform called Adalo that supports a feature called “External Collections” which is exactly what I am looking for - they treat JSON collections returned by an external API as just another collection/tables and can be used in all cases where a collection can be used (they even reverse engineer the schema from a sample run of the API). Is there any way this can be achieved in Glide?

Hola!

Well, Glide lets you use the received data as a big array if you want but I agree, if we can manipulate all this from a dynamic table, it will be great in most cases.

Check https://apipheny.io/ to get the data on a Google sheet and then use it in glide as a normal table

But he wants to avoid that.

Instead, he wants something like this:

It is possible to automatically fetch data every hour.

Anyway. What is your solution?

Hola @Gerard_Fernandez

What I understood is:

  • he wants to receive all data from an API request into a kind of Glide dynamic table (“skip storing this remote data into tables”), something similar to what Adalo does, he called it "External Collections” .
    With it, I guess that any APP doesn’t consume rows. The case is opposite if you put all this in a Google Sheet, you will have to read and sync that data constantly and your APP’s row usage will be higher.

What we do in these cases is what this thread shows (what my example does too) using a transpose trick: Fetch Data from API and display array result in Collection

Saludos!

`

Vale. Gracias
No habĂ­a entendido que no querĂ­a consumir filas

Saludos!!!

1 Like