Object list for json

I have a list of objects :

I’m feeding it to the page, and I’m having trouble passing to the json and saving in Firebase

what have i tried:

and HTTP REQUEST JSON :

“atracoes”: { “arrayValue”: { “values”: [ pageVars.atracoes ] }

any idea to help?

Can you be more specific? It’s not clear how you’re running this, what you’re calling, etc.

I will explain better

I’m feeding the database (firebase) by a page created in appgyver, and on that page, I have a page variable that is a list of objects, my question is how do I pass this list of objects via JSON to the database ( firebase) by HTTP REQUEST or by appgyver’s own Create Record

A few things.

Firestore
If you’re using Google Firebase Firestore, that’s a somewhat differently-structured database. For those of us who are used to relational databases (like MySQL), Firestore is extremely strange, hard to understand, and even harder to use on any kind of scale. That being said, AG has a built-in way to connect to and use Firestore, which you can find under Data -> Connectors and also Data -> Data Resources -> Add Data Resource.

Realtime Database
If you’re using Google Realtime Database, it’s another no-SQL database but this one is essentially just a large JSON structure. This makes alot more sense to those of used to relational databases and/or working with data trees. There’s reasons to use Realtime Database over Firestore, but there’s also reasons not to, with built-in potential negative outcomes if you’re not careful in your implementation/usage (like syncing the entire database to all of your users’ devices, bandwidth usage because of the auto-sync features, etc.). There is a definite learning curve in figuring out Realtime Database, but, once you understand, it’s not that complicated.

The problem, here, is that there is no built-in functionality in AG for it, so you have to interact through REST queries: to do this, you’ll need to build your own internal API on something like Google Cloud Functions, send your data/requests to your Cloud Functions endpoint, process the logic through Cloud Functions, have Cloud Functions do the database engagement, and return the Realtime Database information to AG through Google Cloud Functions.

I know this is alot, so I made a sloppy graphic to try to help:

1 Like

Thanks for the explanation, so in short, i use firestore, i couldn’t pass a thanks list of objects via HTTP REQUEST ?

You have to follow the requirements of the Firestore structure and use their API and/or libraries, as designed. As I mentioned previously, AG provides a way to somewhat more easily interact with Firestore from within AG, but you are still bound by the details of Firestore.

Although Firestore (and RTD) are easier for new users to engage with than SQL databases, nothing is as simple as sending a “list of objects” to any normal database. (If you want to do something along those lines, then you should explore some of the no-code database options, which also have their own APIs, API requirements, and issues.)