AirtableFUNT

node v10.23.1
version: 1.0.0
endpointsharetweet
const express = require('express'); const app = express() app.use(express.json()); var Airtable = require('airtable'); var base = new Airtable({apiKey: process.env.AIRTABLE_API_KEY}).base(process.env.CHATBOTFUN_BASE); app.listen(3000, () => console.log('Example app listening on port 3000!')) app.get('/', (req, res) => { var resp = ''; let responseJson = {}; responseJson.fulfillmentText = 'This is an endpoint published to RunKit'; // displayed response base('PrecioCiudad').select({ maxRecords: 1, filterByFormula: 'AND({Programa} = "Auxiliar contable ",{Ciudad}="Sincelejo")', }).eachPage(function page(records, fetchNextPage) { records.forEach(function(record) { resp += 'El ' + record.get('Atributo')+' de '+ record.get('Programa')+ ' es: '+record.get('Inicio')+', el horario es '+record.get('Horario')+', la duracion es de '+record.get('Duracion')+', Se imparte en estas sedes '+record.get('Ciudad'); console.log('Retrieved', record.get('Inicio'+'Horario'+'Duracion'+'Ciudad')); }); fetchNextPage(); }, function done(err) { if (err) { console.error(err); return; } res.send(resp); }); })
Loading…

no comments

    sign in to comment