Help

Upcoming database upgrades. Airtable functionality will be reduced for ~15 minutes at 06:00 UTC on Feb. 4 / 10:00 pm PT on Feb. 3. Learn more here

Command to get data as javascript variables

Topic Labels: API
1505 0
cancel
Showing results for 
Search instead for 
Did you mean: 

Hi! Dear,

Would you please let me know is there anyway to have result record as (text)variables in Javascript ?

Image as:

//////////////////////////////////////////////////////////

function getData(){

base(‘New Playlists’).select({
filterByFormula: ‘ID = MyFunIDValue’,
}).eachPage(function page(records, fetchNextPage) {
records.forEach(function(record) {
return record.get(‘ID’);
});

}, function done(error) {

});

}

var data = getData();

alert(data);

//////////////////////////////////////////////////////////

in this way I could have only result “undefined”…

I thought it is trouble with asymetric treatment.

but it didn’t work well

like this…

$.when(
getData()
).done(function(){
alert(result);
});

Please tell me what should be fixed or is there another command smart,

like just

getData(table,field,formula)

0 Replies 0