Skip to main content

Source Data Read

Overview

Use these commands to intercept the source-data-read command.

Input/OutputData Type
InputStdSourceDataReadInput
OutputStdSourceDataReadOutput

Example StdSourceDataReadInput

{
"sourceDataKey": "name",
"queryInput": {
"query": "fetchAll",
"limit": 10
}
}

Example StdSourceDataReadOutput

[
{
key: 'id',
label: 'Id',
subLabel: 'Airtable Base Id'
},
{
key: 'name',
label: 'Name',
subLabel: 'Airtable Source Table Name'
}
]

Implementation

Before source-data-read command

Use this logic to implement the command:

    .beforeStdSourceDataRead(async (context: Context, input: StdSourceDataReadInput) => {
logger.info(`Running before source data read. Query: ${input.queryInput?.query}`)
return input
})

The input object can be mutated and returned, but the same data type must still be returned.

After source-data-read command

Use this logic to implement the command:

    .afterStdSourceDataRead(async (context: Context, output: StdSourceDataReadOutput) => {
logger.info(`Running after source data read first query record key: ${output[0].key}`)
return output
})

The output object can be mutated and returned, but the same data type must still be returned.