Browse Source

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

Handle error when running a a Query Rows automation with a deleted column
pull/5073/head
Peter Clement 4 years ago
committed by GitHub
parent
commit
bda860693f
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      packages/server/src/automations/steps/queryRows.js

2
packages/server/src/automations/steps/queryRows.js

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

Loading…
Cancel
Save