diff --git a/packages/server/src/automations/steps/queryRows.js b/packages/server/src/automations/steps/queryRows.js index b02f31b1ec..cfff039221 100644 --- a/packages/server/src/automations/steps/queryRows.js +++ b/packages/server/src/automations/steps/queryRows.js @@ -125,6 +125,14 @@ const hasNullFilters = filters => exports.run = async function ({ inputs, appId }) { const { tableId, filters, sortColumn, sortOrder, limit } = inputs + if (!tableId) { + return { + success: false, + response: { + message: "You must select a table to query.", + }, + } + } const table = await getTable(appId, tableId) let sortType = FieldTypes.STRING if (table && table.schema && table.schema[sortColumn] && sortColumn) {