Nov 01, 2016 08:47 AM
base('Test Space Request 2016').select({
view: "Main View",
filterByFormula: "({Requester Name} = 'Mo Biegel')"
}).eachPage(function page(records, fetchNextPage) {
}, function done(error) {
});
For some reason this isn’t bringing up any data, any ideas why?
via CURL:
https://api.airtable.com/v0/appO7dvt1H3N3gLmB/Test%20Space%20Request%202016?filterByFormula=({Requester%20Name}="Mo%20Biegel")
Thanks!
Nov 01, 2016 01:27 PM
Not sure, but two things stood out:
Is it possible that ‘Mo Biegel’ is not present in the “Main View” view? You specified that view in the JS example, but not the cURL example. Try removing the view parameter?
The curly brackets or parentheses in your filterByFormula are not URL encoded. In my testing, that breaks the cURL request. Try https://api.airtable.com/v0/appO7dvt1H3N3gLmB/Test%20Space%20Request%202016?filterByFormula=({Reques...
In my experience with the Airtable API (which is limited to PHP and cURL), I have to ensure that everything is properly URL encoded before I make a request.
Nov 01, 2016 01:40 PM
Nov 01, 2016 01:53 PM
Gotcha. I did a quick test using the official Airtable JS library on GitHub and it handled spaces just fine. I’m guessing that you simply removed the code from your example above that actually does something with the results, but does the following work?
base('Test Space Request 2016').select({
filterByFormula: "({Requester Name} = 'Mo Biegel')"
}).eachPage(function page(records, fetchNextPage) {
records.forEach(function(record) {
console.log('Retrieved ', record.get('Name space'));
alert('Retrieved ', record.get('Name space'));
});
fetchNextPage();
}, function done(error) {
console.log(error);
});
Nov 01, 2016 02:18 PM
That worked!!! Thanks man!
Not sure if I should open another question about the following: what if I want to filter by date?
filterByFormula: "({Prep Start Date} = '2016-10-24')"
That isn’t bringing anything up, there is a row that matches…
Nov 01, 2016 04:13 PM
Try the filterByFormula:
IS_SAME({Prep Start Date},TODAY(),'day')
You could also do:
DATETIME_DIFF({Prep Start Date},TODAY(),'days')=0
And (probably not last):
DATETIME_FORMAT({Prep Start Date}, 'YYYY-MM-DD') = "2016-11-01"
The complete reference for available Formulas is at
For an overview of formula fields, please refer to the Guide to Formula, Lookup, Count, and Rollup fields. Formulas may involve functions, numeric operations, logical operations, and text operation...
Nov 02, 2016 06:48 AM
IS_SAME worked - thanks Chester I really appreciate your help!