modules

ac-bundle-module-utils-airtable-image

utils/airtable/image.js

A module for ac-bundle-app, published by ac-bundle-module.

Available Methods: fill

fill

function(record, key, value) {
  if (app.has(value) && value !== false) {
    var list = [];
    if (typeof value === "string") {
      list.push({url: value});
    } else {
      for (var i=0; i<=value.length-1; i++) {
        list.push({url: value[i]});
      }
    }
    record.fields[key] = list;
    var json = JSON.stringify(record.fields[key]);
    if (record.fields["_" + key] === json) delete record.fields[key];
    record.fields["_" + key] = json;
  }
}

Happy Coding!

Leave a Reply

Your email address will not be published. Required fields are marked *