Merge pull request #4976 from Budibase/fix/query-rows-automation-fix

Handle error when running a a Query Rows automation with a deleted column
This commit is contained in:
Peter Clement 2022-03-22 16:24:59 +00:00 committed by GitHub
commit 7a45d8dd23
1 changed files with 1 additions and 1 deletions

View File

@ -85,7 +85,7 @@ exports.run = async function ({ inputs, appId }) {
const { tableId, filters, sortColumn, sortOrder, limit } = inputs const { tableId, filters, sortColumn, sortOrder, limit } = inputs
const table = await getTable(appId, tableId) const table = await getTable(appId, tableId)
let sortType = FieldTypes.STRING let sortType = FieldTypes.STRING
if (table && table.schema && sortColumn) { if (table && table.schema && table.schema[sortColumn] && sortColumn) {
const fieldType = table.schema[sortColumn].type const fieldType = table.schema[sortColumn].type
sortType = sortType =
fieldType === FieldTypes.NUMBER ? FieldTypes.NUMBER : FieldTypes.STRING fieldType === FieldTypes.NUMBER ? FieldTypes.NUMBER : FieldTypes.STRING