Skip to content

The open alternative to Salesforce, designed for AI.

Fix variables coming from DB events (#14545)

Thomas Trompette5695202d310f
diff --git a/packages/twenty-front/src/modules/workflow/workflow-variables/components/WorkflowVariablesDropdownStepItems.tsx b/packages/twenty-front/src/modules/workflow/workflow-variables/components/WorkflowVariablesDropdownStepItems.tsx
index 0b14c171722..f63191ac2fb 100644
--- a/packages/twenty-front/src/modules/workflow/workflow-variables/components/WorkflowVariablesDropdownStepItems.tsx
+++ b/packages/twenty-front/src/modules/workflow/workflow-variables/components/WorkflowVariablesDropdownStepItems.tsx
@@ -73,7 +73,7 @@ export const WorkflowVariablesDropdownStepItems = ({
onSelect(
getVariableTemplateFromPath({
stepId: step.id,
- path: [...currentPath, 'id'],
+ path: [...currentPath, currentSubStep.object.fieldIdName ?? 'id'],
}),
);
};
diff --git a/packages/twenty-front/src/modules/workflow/workflow-variables/types/RecordOutputSchemaV2.ts b/packages/twenty-front/src/modules/workflow/workflow-variables/types/RecordOutputSchemaV2.ts
index 236c232812f..b6db5367cca 100644
--- a/packages/twenty-front/src/modules/workflow/workflow-variables/types/RecordOutputSchemaV2.ts
+++ b/packages/twenty-front/src/modules/workflow/workflow-variables/types/RecordOutputSchemaV2.ts
@@ -28,6 +28,7 @@ export type RecordOutputSchemaV2 = {
label: string;
objectMetadataId: string;
isRelationField?: boolean;
+ fieldIdName?: string;
};
fields: Record<string, FieldOutputSchemaV2>;
_outputSchemaType: 'RECORD';