diff --git a/packages/server/src/automations/actions.js b/packages/server/src/automations/actions.js index ed3ad7b591..ac0ae63c36 100644 --- a/packages/server/src/automations/actions.js +++ b/packages/server/src/automations/actions.js @@ -10,7 +10,8 @@ const os = require("os") const fs = require("fs") const Sentry = require("@sentry/node") -const DEFAULT_BUCKET = "https://prod-budi-automations.s3-eu-west-1.amazonaws.com" +const DEFAULT_BUCKET = + "https://prod-budi-automations.s3-eu-west-1.amazonaws.com" const DEFAULT_DIRECTORY = ".budibase-automations" const AUTOMATION_MANIFEST = "manifest.json" const BUILTIN_ACTIONS = { diff --git a/packages/server/src/automations/triggers.js b/packages/server/src/automations/triggers.js index e4e578c04d..e57ae66a82 100644 --- a/packages/server/src/automations/triggers.js +++ b/packages/server/src/automations/triggers.js @@ -124,6 +124,7 @@ async function fillRecordOutput(automation, params) { const db = new CouchDB(params.instanceId) try { let model = await db.get(modelId) + let record = {} for (let schemaKey of Object.keys(model.schema)) { if (params[schemaKey] != null) { continue @@ -131,19 +132,20 @@ async function fillRecordOutput(automation, params) { let propSchema = model.schema[schemaKey] switch (propSchema.constraints.type) { case "string": - params[schemaKey] = FAKE_STRING + record[schemaKey] = FAKE_STRING break case "boolean": - params[schemaKey] = FAKE_BOOL + record[schemaKey] = FAKE_BOOL break case "number": - params[schemaKey] = FAKE_NUMBER + record[schemaKey] = FAKE_NUMBER break case "datetime": - params[schemaKey] = FAKE_DATETIME + record[schemaKey] = FAKE_DATETIME break } } + params.record = record } catch (err) { throw "Failed to find model for trigger" }