Cannot access data from Airtable

Good Evening,

Firstly, thank you for this tool… i’ve just started using it but i love the way the logic can be structured.

I’ve just started a new app and have hit a wall. I have managed to add a REST API direct connection to my test db in Airtable. When I run the test i get a response with the correct fields and values stored in them.

Lets call this the master table which gets read only once when the app is launched.

I then want to duplicate this table on the client side and access the values from the “clone” table to feed the app. However, i cannot figure out how to transfer these values. I have tried using app variables, data variables and page variables but cannot seem to draw the data into the app.

If someone has a step by step guide, please post it here.

The way i understand it is… as follows:

  1. “Get record collection” from master table
  2. “Update record” to client table
  3. “Set variable” from values stored in client table
  4. Bind variable to input field

Have i missed something?

Thanks in advance.

I hope I can help here because I’ve been doing this a lot for my app.

Attached is the image of the logic for one of my Data Variables. (I’m not sure this is the best way - but it definitely works!)

What I do is get the record collection, set the data variable, then set a page variable using the “Map” function. (The page variable has already been declared in the Page Variable tab - with the correct schema)

Then I use a formula in the “set page variable” element shown below.

MAP(data.Countries, {“Country”:item.fields.Country, “Singer”: item.fields.Singer, “Song”: item.fields.Song, “TotalPoints”: 0, “Position”: IF(appVars.WhichView == “FinalView”, item.fields.finalPerfOrder, item.fields.semiPerfOrder), “ImageUrl”: item.fields.Images[0].thumbnails.large.url, “OneSevenBool”: false, “Eight”: false, “Ten”: false, “Twelve”: false, “OneToSeven”: 0, “JuryPoints”:0, “HasHadThumbs”: false})

What this MAP does is iterate though the data variable called “Countries” and creates a new array (CountryObjectArray) using elements from the Country array (accessed using the item. syntax). As you can see, it can even include logic to decide what to include in the new page variable (the “IF” statement).

I hope that helps some.

Oli

Hi Oli,

Thanks for the reply. I’ll give it a bash. Do you know if it’s possible to use a module like flipclock.js in appgyver?

Thanks for your help.

Aadil.

Hey Adil, I’m afraid that I know nothing about Javascript so I can’t help you other than to say that I’ve noticed that there is a javascript logic element - I assume that runs javascript - so you could try it there!

Oli

The current JavaScript node is limited to data transformation and some native API calls like fetch on web; you can’t unfortunately render things yet. That will be possible with https://tracker.appgyver.com/feature-requests/p/custom-react-native-react-web-plugins

Thanks for the feedback.

I’ll get the rest done in the meantime…

Hi Guys… Still trying to get my records out of the backend.

“Get record collection” shows me a list of the available tables both local and remote, but gives me an Error: rawError for any selected table.

I have attached a screenshot.

Can you show how your iDate data resource is structured?

Hi Harri,

Please see below:

Test…

Schema


Thanks for the help.

Hi,

How is your “Set page variable” module looking like? What is the schema for Page variable? The get collection module will return an array so you might need to use iDate[0] to access the single object returned from your array. Are you assigning the whole record to page variable including id, fields and created date?

When you look in to the “state” tab in Debuger - is the app properly fetching data from Airtable?