From 1a42483aa9faaa6ba1f694440b37e3059f308e5d Mon Sep 17 00:00:00 2001 From: martmull Date: Fri, 24 Jan 2025 15:11:30 +0100 Subject: [PATCH] Fix wrong label formatting (#9830) Fixes https://discord.com/channels/1130383047699738754/1324785862830985266 ## Before image ## After image --- .../WorkflowVariablesDropdownFieldItems.tsx | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/packages/twenty-front/src/modules/workflow/workflow-variables/components/WorkflowVariablesDropdownFieldItems.tsx b/packages/twenty-front/src/modules/workflow/workflow-variables/components/WorkflowVariablesDropdownFieldItems.tsx index 23397bfd1..fe4947fdb 100644 --- a/packages/twenty-front/src/modules/workflow/workflow-variables/components/WorkflowVariablesDropdownFieldItems.tsx +++ b/packages/twenty-front/src/modules/workflow/workflow-variables/components/WorkflowVariablesDropdownFieldItems.tsx @@ -115,7 +115,20 @@ export const WorkflowVariablesDropdownFieldItems = ({ } }; - const headerLabel = currentPath.length === 0 ? step.name : currentPath.at(-1); + const getHeaderLabel = () => { + if (currentPath.length === 0) { + return step.name; + } + + const subStepName = currentPath.at(-1); + + if (isDefined(subStepName) && isRecordOutputSchema(step.outputSchema)) { + return step.outputSchema.fields[subStepName].label; + } + + return subStepName; + }; + const displayedObject = getDisplayedSubStepFields(); const options = displayedObject ? Object.entries(displayedObject) : []; @@ -134,7 +147,7 @@ export const WorkflowVariablesDropdownFieldItems = ({ onClick={goBack} style={{ position: 'fixed' }} > - +