Usar api de google

HOLA!
Espero estén bien.
Mi nivel de entendimiento de API es muy básico, pero sé que lo que tengo planeado se puede realizar y me gustaría recibir ayuda de su parte.

En la fábrica hay máquinas que trabajan cierto número de horas al día, los registran sus horometros iniciales y finales en un formulario de google, y esto me lo lleva a una hoja, hasta allí todo bien.
Me gustaría usar la API para obtener esos datos por máquina sin necesidad de usar formularios en glide sino que se actualice automáticamente y obtener estadísticas para programar mantenimientos.

Alguna ayuda, algún paso a paso.

Les agradecería mucho.



esta es básicamente la estructura y quiero obtener esos datos en una columna para luego armar un gráfico

If you connect your app to your google sheet as a data source, then it should be syncronized automatically. There is no need to use an API to get the data. With that said, you could still create a form in Glide to enter the machine data and eliminate the need for a separate Google form. The data would still be updated in the google sheet.

1 Like

Al vincularlo me consume actualizaciones? Me gustaría usar una api para que al momento de obtener la información no tenga tanta latencia, o sea que pueda hacer una llamado a la api cada 10 segundos y obtener estadisticas. Esto es un proyecto, porque me gustaría usar sensores IoT para obtener info en tiempo real

Depends on how you set it up to call the API, but in some cases calling an API could use updates as well. The biggest thing to consider is security of your API. If you use a Call API action, it will be more secure because you are calling the API from the server. If you run the API from a javascript column, then it is not as secure as API keys are exposed, and each individual device is calling the API instead of one main server, so you run the risk of hitting rate limits on the API much faster.

The other problem with calling an API is that you need a table large enough to hold the maximum number of rows your google sheet would every have, then use a bunch of computed columns to unpack the results from that API into those existing rows and columns. It takes a bit of setup. I’m also not sure how wise it is to call an API every 10 seconds, especially if there aren’t changes to the data all the time. Overall, it’s not easily scalable.

If you connect a google sheet to your app, then the main thing you have to worry about is Sync updates which will count every time you need to sync any updated data. It will be much easier to set up. The best you can do with syncing is maybe every few minutes. I would say at least try it and see how well it works for you before going down the path of trying to do everything through an API.

@gvalero has done quite a bit with IoT, so he could probably give you better advice based on his past experience.

2 Likes

Muchas gracias amigo por tu aporte, pero ya probé integrando la hoja y se me hace complicado usarlo de esa forma, me gustaría leer la opinión de @gvalero a ver en qué podría ayudarme con este tema.

1 Like

Hola @Wilkin_Estrada_Ayola , feliz día!

Voy a complementar las sugerencias de @Jeff_Hager que son válidas y tratar de ayudarte en lo que necesitas para minimizar actualizaciones. Yo entiendo el tema de los costos y la frecuencia en el envío de datos que generan las máquinas, es un dolor de cabeza poder balancear esto.

Empecemos por mostrarte mi demo basado en IoT, aquí puedes verlo y jugar con él https://myfactory.glide.page/

El cómo trabaja y su arquitectura se explica aquí: 🚨 Glide working as GUI for IIoT projects

Si te sirve, puedo seguirte ayudando con gusto o me escribes por privado para no llenar este post con comentarios muy específicos que escapan del objetivo de Glide.

Saludos!

1 Like

Ya te escribo mi amigo, muchas gracias!