Mar 03, 2020 07:44 AM
Is there a sample code snippet to pass table records into a function? Do I also need to pass the table or field itself (because I need the field to get cell value, or the table to get the field, right?)
Mar 05, 2020 09:26 AM
Thanks, the example is very helpful.
It probably should be documented what types are returned when getCellValue is called on different fields. That belongs in Airtable Scripting Block documentation - it’s not a Javascript not easy issue. If all functionality such as date processing are reliant on Javascript itself then by default it should return a Date object instead of a string, etc.
Mar 05, 2020 09:33 AM
It is there, @ATG – it’s in the “Cell values & field options” section, which is linked to from the record.getCellValue()
documentation:
Mar 07, 2020 08:28 PM
Can I chime in with my thoughts on the Scripting Block documentation?
I think that the information in the Scripting API documentation is excellent.
However, the documentation does leave several things to be desired.
The documentation window is tiny. This discourages people from using it. It is also very hard to see the documentation, a significant portion of code, and actual records all at the same time. When trying to put everything together, it would be nice to be able to comfortable see them all at the same time.
At times the documentation oversimplifies things for users who already know JavaScript (such as not differentiating between properties and methods). Yet at other times it overly complicates things for users who don’t know how to read computer documentation (parameter signatures).
Navigation within a section of the documentation is poorly supported. If you want to know what is covered in a section, you have to manually scrolling until you get to the info you want.
Then, there are a few minor quirks:
The documentation does not cover some items that I think should be covered, because they are unique to Scripting block. (I’ve run into this twice.)
The Scripting block does not always follow documented behavior. (I’ve run into this multiple times.)
The Scripting block editor sometimes is overly enthusiastic in flagging possible errors.
There are undocumented features. (I’ve run into one.)
Mar 07, 2020 09:46 PM
I second this - some of the information I was looking for was there but took too much scrolling to find.
There should be a short intro laying out the principles (API only for loading updating data, use Javascript for everything else including filters instead of views, whether queries should be global variables or passed as parameters, etc); code snippets for basic things like sorting, filtering; how references/linked fields should be handled; when to calculate in Airtable formulas and when to handle in Scripting block; how to build shares libraries to extend Airtable API, common libraries to link, how to map Airtable data types to Javascript and any common issues, etc. I found the examples not to be that relevant to be honest.
Would be much easier to pick up with a quick primer like this
Mar 08, 2020 04:40 AM
In 2007 Google released Google Apps Script and it wasn’t until well into the next decade that examples emerged that truly helped users grasp the the subtle differences between Google Apps Script and javascript (lowercase).
Indeed, I agree that we need better examples. but keep in mind that this new feature was created a few months ago and release from beta under great pressure from the community. It’s bound to have significant documentation gaps.
Often, we want these new features in the worst way, but we’re also annoyed when we get them in the worst condition. :slightly_smiling_face:
Mar 08, 2020 04:53 AM
True, except…one is free, and the other isn’t.
Mar 08, 2020 05:31 AM
Hmmm… does that really matter? They both have free tiers; they both have paid tiers.