1
0
Fork 0
mirror of synced 2024-07-30 02:26:11 +12:00

add collect bloc definition

This commit is contained in:
Peter Clement 2023-05-09 12:04:32 +01:00
parent 9b66b30969
commit ac57a849ce

View file

@ -0,0 +1,53 @@
import {
AutomationActionStepId,
AutomationStepSchema,
AutomationStepInput,
AutomationStepType,
AutomationIOType,
} from "@budibase/types"
export const definition: AutomationStepSchema = {
name: "Collect Data",
tagline: "Collect data to be sent to design",
icon: "Collection",
description:
"Collects specified data so it can be provided to the design section",
type: AutomationStepType.ACTION,
internal: true,
canLoop: false,
stepId: AutomationActionStepId.COLLECT,
inputs: {
text: "",
},
schema: {
inputs: {
properties: {
collection: {
type: AutomationIOType.STRING,
title: "What to Collect",
},
},
required: ["text"],
},
outputs: {
properties: {
success: {
type: AutomationIOType.BOOLEAN,
description: "Whether the action was successful",
},
value: {
type: AutomationIOType.STRING,
description: "Collected data",
},
},
required: ["success", "value"],
},
},
}
export async function run({ inputs }: AutomationStepInput) {
return {
success: true,
value: inputs.collection,
}
}