bergant / airtabler

R interface to the Airtable API
Other
91 stars 16 forks source link

JSON object in air_insert missing records property #12

Open collinschwantes opened 3 years ago

collinschwantes commented 3 years ago

The airtable api examples show fields for created records are stored in an array inside a records property. Slight change of the air_insert function achieves expected JSON structure.

Expected JSON

'{
  "records": [
    {
      "fields": {
        "Name": "replacement",
        "value": 100,
        "Results": "Positive",
        "Some Linked Record": ["someID1234"]
      }
    }
  ]
}'

Change to R code in air_insert

  fields <- list(fields = record_data)
  records <- list(records = list(fields))