-
Notifications
You must be signed in to change notification settings - Fork 5
/
test.js
28 lines (23 loc) · 890 Bytes
/
test.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
var Airtable = require('airtable');
var base = new Airtable({apiKey: process.env.AIRTABLE_API_KEY}).base(process.env.AIRTABLE_BASE);
base( "Mentees" ).select( {
filterByFormula: `NOT({Assigned?} = "true")`
, view: "Main View"
} ).firstPage( ( err, records ) => {
if ( err ) {
return console.error( err );
}
const mentees = records.map( record => `@${ record.get( "Slack User" ) }` );
console.log('*Mentees without mentors: *\n' + mentees.join("\n"));
} );
text = 'python';
base( "Mentees" ).select( {
filterByFormula: `SEARCH(LOWER("${text}"), LOWER({Language})) >= 1`
, view: "Main View"
} ).firstPage( ( err, records ) => {
if ( err ) {
return console.error( err );
}
const mentees = records.map( record => `@${ record.get( "Slack User" ) }` );
console.log(`*Mentees for ${ text }:*\n ${ mentees.join( "\n" ) }` );
} );