diff --git a/packages/builder/src/components/automation/SetupPanel/AutomationBlockSetup.svelte b/packages/builder/src/components/automation/SetupPanel/AutomationBlockSetup.svelte
index ff52c7d11a..daac9427b2 100644
--- a/packages/builder/src/components/automation/SetupPanel/AutomationBlockSetup.svelte
+++ b/packages/builder/src/components/automation/SetupPanel/AutomationBlockSetup.svelte
@@ -9,7 +9,10 @@
Label,
ActionButton,
Drawer,
+ Modal,
} from "@budibase/bbui"
+ import CreateWebhookModal from "components/automation/Shared/CreateWebhookModal.svelte"
+
import { automationStore } from "builderStore"
import { tables } from "stores/backend"
import WebhookDisplay from "../Shared/WebhookDisplay.svelte"
@@ -27,13 +30,15 @@
import { buildLuceneQuery } from "helpers/lucene"
export let block
- export let webhookModal
export let testData
export let schemaProperties
export let isTestModal = false
+
+ let webhookModal
let drawer
let tempFilters = lookForFilters(schemaProperties) || []
let fillWidth = true
+
$: stepId = block.stepId
$: bindings = getAvailableBindings(
block || $automationStore.selectedBlock,
@@ -205,7 +210,10 @@
{bindings}
/>
{:else if value.customType === "webhookUrl"}
-
+ onChange(e, key)}
+ value={inputData[key]}
+ />
{:else if value.customType === "triggerSchema"}
onChange(e, key)} value={inputData[key]} />
{:else if value.customType === "code"}
@@ -247,6 +255,10 @@
{/each}
+
+
+
+
{#if stepId === "WEBHOOK"}
{/if}
diff --git a/packages/server/src/automations/triggerInfo/app.js b/packages/server/src/automations/triggerInfo/app.js
index 40d1531fa0..b1b07e9d5b 100644
--- a/packages/server/src/automations/triggerInfo/app.js
+++ b/packages/server/src/automations/triggerInfo/app.js
@@ -22,6 +22,7 @@ exports.definition = {
fields: {
type: "object",
description: "Fields submitted from the app frontend",
+ customType: "triggerSchema",
},
},
required: ["fields"],
diff --git a/packages/server/src/automations/triggers.js b/packages/server/src/automations/triggers.js
index ae98f0e73a..f774c23123 100644
--- a/packages/server/src/automations/triggers.js
+++ b/packages/server/src/automations/triggers.js
@@ -81,16 +81,19 @@ exports.externalTrigger = async function (
params,
{ getResponses } = {}
) {
- if (automation.definition != null && automation.definition.trigger != null) {
- if (automation.definition.trigger.stepId === "APP") {
- // values are likely to be submitted as strings, so we shall convert to correct type
- const coercedFields = {}
- const fields = automation.definition.trigger.inputs.fields
- for (let key of Object.keys(fields)) {
- coercedFields[key] = coerce(params.fields[key], fields[key])
- }
- params.fields = coercedFields
+ if (
+ automation.definition != null &&
+ automation.definition.trigger != null &&
+ automation.definition.trigger.stepId === definitions.APP.stepId &&
+ !checkTestFlag(automation._id)
+ ) {
+ // values are likely to be submitted as strings, so we shall convert to correct type
+ const coercedFields = {}
+ const fields = automation.definition.trigger.inputs.fields
+ for (let key of Object.keys(fields)) {
+ coercedFields[key] = coerce(params.fields[key], fields[key])
}
+ params.fields = coercedFields
}
const data = { automation, event: params }
if (getResponses) {