I’ve developed some Access VBA code which reads and writes to the Airtable API quite nicely using a module to parse the JSON.
My own use-case scenario is to generate printed labels with QR Codes and make sure that my base stays synchronized when new labels are printed, but the code could be developed to nearly any need, and most especially if you have an Access DB that needs to be uploaded to AT, this could would also work very well for that.
Are there others who would find this code useful to share?
Or, can I help anybody to convert their data for a reasonable fee?
Let me know!
Sorry I didn’t see this sooner, looks like my spam filter got ahold of it
In order to “talk JSON” from VBA/VBScript, you need a handy dandy parser object, I use this one:
In one of my projects, I have a table called Assets. Here is the code to create an Asset record from within MS Access:
Public Function AddAsset(strDesc As String) As String Dim oj As New clsJSON, data, strOut As String, s As String Dim authnetStatus, authnetVal, xml, strURL As String ' On Error GoTo getAssetTags_Error On Error Resume Next strURL = "https://api.airtable.com/v0/123123/Assets" ' & strID ' ' Debug.Print strURL Set oj = New clsJSON Set xml = CreateObject("Microsoft.XMLHTTP") xml.Open "POST", strURL, False xml.setRequestHeader("Content-type") = "application/json" xml.setRequestHeader("Authorization") = "Bearer key456456" oj.data.Add oj.Collection() oj.data.Add "fields", oj.Collection oj.data("fields").Add "Description", strDesc data = oj.JSONoutput xml.send data authnetStatus = CStr(xml.Status) authnetVal = xml.responseText AddAsset = authnetVal ' oj.JSONoutput ' On Error GoTo 0 Exit Function getAssetTags_Error: MsgBox "Error " & Err.Number & " (" & Err.Description & ") in procedure getAssetTags of Module modAirTables" End Function
The trick to getting it to work as expected is in referencing and dereferencing the JSON object, but once you get the hang of it, it’s not too bad.
Nope, you’ll see I posted 456456 for the key, and 123123 for the app id.
In the case of the function above, the database can create an Asset record in Airtable by passing only one value, strDesc.
The purpose of this particular little project was to print dymo labels for Assets in the database, complete with QR codes to lookup the Asset with.
Nice, I am integrating to make custom feature specific mobile apps that interface with Airtable …
Will be integrating with mobile printers later for barcode generation on demand but not sure which ones.