diff --git a/packages/client/src/components/app/blocks/CardsBlock.svelte b/packages/client/src/components/app/blocks/CardsBlock.svelte
index f0892ca447..fe2af2e12d 100644
--- a/packages/client/src/components/app/blocks/CardsBlock.svelte
+++ b/packages/client/src/components/app/blocks/CardsBlock.svelte
@@ -39,6 +39,7 @@
number: "numberfield",
datetime: "datetimefield",
boolean: "booleanfield",
+ formula: "stringfield",
}
let formId
diff --git a/packages/client/src/components/app/blocks/TableBlock.svelte b/packages/client/src/components/app/blocks/TableBlock.svelte
index 3de4497731..cd38908545 100644
--- a/packages/client/src/components/app/blocks/TableBlock.svelte
+++ b/packages/client/src/components/app/blocks/TableBlock.svelte
@@ -35,6 +35,7 @@
number: "numberfield",
datetime: "datetimefield",
boolean: "booleanfield",
+ formula: "stringfield",
}
let formId
@@ -60,10 +61,11 @@
let enrichedFilter = [...(filter || [])]
columns?.forEach(column => {
const safePath = column.name.split(".").map(safe).join(".")
+ const stringType = column.type === "string" || column.type === "formula"
enrichedFilter.push({
field: column.name,
- operator: column.type === "string" ? "string" : "equal",
- type: column.type === "string" ? "string" : "number",
+ operator: stringType ? "string" : "equal",
+ type: stringType ? "string" : "number",
valueType: "Binding",
value: `{{ ${safe(formId)}.${safePath} }}`,
})
diff --git a/packages/client/src/components/app/forms/Field.svelte b/packages/client/src/components/app/forms/Field.svelte
index 79de01351a..ca7bd3caaf 100644
--- a/packages/client/src/components/app/forms/Field.svelte
+++ b/packages/client/src/components/app/forms/Field.svelte
@@ -32,6 +32,7 @@
validation,
formStep
)
+ $: schemaType = fieldSchema?.type !== "formula" ? fieldSchema?.type : "string"
// Focus label when editing
let labelNode
@@ -72,7 +73,7 @@
- {:else if fieldSchema?.type && fieldSchema?.type !== type && type !== "options"}
+ {:else if schemaType && schemaType !== type && type !== "options"}