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

Filter by Field? Twilio

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

Hi All,

This is for a Twilio Call IVR.

Is there a way with Airtable-Node Module to filter by Field and not ID.

I guess its kinda like a number look up and give back the value of the field?

1234 gathered digits on a call gets back a field, like status.

The code below returns four IDs
Sorry I am learning to code JS.

exports.handler = async (event, context, callback) => {

try {

    const { records } = await airtable.list()

    const appointments  = records.map((appointment) => {

        //console.log(appointment)

        const  id  = appointment

        const { name, PIN, Result, Status, Phone_Number } = appointment.fields

        console.log(PIN)

       // const url = image[0].url

        return { id, name, PIN, Result, Status, Phone_Number }        

    })

      callback(null, {

         statusCode: 200,

         body: JSON.stringify( appointments ),

    })

} catch (err) {

    callback(null, {

        statusCode: 500,

        body: 'Server Error',

    })

}  

}

Thanks

0 Replies 0