Newbie trying to get my feet wet using a custom form to create new records. I am following the samples provided with the API documentation but the script completes before Airtable is able to finish it’s create function. I didn’t realize that was the problem until I threw in an alert() command to help me debug. That’s when the record would appear in my table.
Looking forward to smacking my forehead when someone shows me some simple thing I am overlooking to stay in the script until Airtable is ready.
Mahalo. (Hawaiian thank you )
<script src="https://code.jquery.com/jquery-1.12.2.min.js"></script>
<script src="js/airtable.browser.js"></script>
<script>
$(document).ready(function(){
var Airtable = require('airtable');
var base = new Airtable({apiKey: 'keyXXXXXXXXXXXXXXX'}).base('appt4hr3kqdqXXXXX');
$('button#submit-bin').click(function() {
base('Parchment').create(
{
"Tag": "3333",
"bin#": 1
},
function(err, record)
{
if (err)
{
console.error(err);
return;
}
console.log(record.getId());
});
});
});
</script>
