diff --git a/packages/server/src/automations/steps/queryRows.ts b/packages/server/src/automations/steps/queryRows.ts index 1d7e8a419e..f12aa49fea 100644 --- a/packages/server/src/automations/steps/queryRows.ts +++ b/packages/server/src/automations/steps/queryRows.ts @@ -13,6 +13,7 @@ import { SearchFilters, Table, } from "@budibase/types" +import { db as dbCore } from "@budibase/backend-core" enum SortOrder { ASCENDING = "ascending", @@ -117,7 +118,11 @@ function typeCoercion(filters: SearchFilters, table: Table) { const searchParam = filters[key] if (typeof searchParam === "object") { for (let [property, value] of Object.entries(searchParam)) { - const column = table.schema[property] + // We need to strip numerical prefixes here, so that we can look up + // the correct field name in the schema + const columnName = dbCore.removeKeyNumbering(property) + const column = table.schema[columnName] + // convert string inputs if (!column || typeof value !== "string") { continue