From 10ccc20b5349b8e5897d079ae1616cec9b10e1e2 Mon Sep 17 00:00:00 2001 From: Dhruwang Jariwala <67850763+Dhruwang@users.noreply.github.com> Date: Wed, 28 May 2025 15:14:55 +0530 Subject: [PATCH] fix: recall not working for NPS question (#5895) --- packages/surveys/src/lib/recall.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/surveys/src/lib/recall.ts b/packages/surveys/src/lib/recall.ts index cace8e174c..6820aa9ef2 100644 --- a/packages/surveys/src/lib/recall.ts +++ b/packages/surveys/src/lib/recall.ts @@ -48,7 +48,7 @@ export const replaceRecallInfo = ( } // Fetching value from responseData or attributes based on recallItemId - if (responseData[recallItemId]) { + if (responseData[recallItemId] !== undefined) { value = (responseData[recallItemId] as string) ?? fallback; } @@ -62,7 +62,7 @@ export const replaceRecallInfo = ( } // Replace the recallInfo in the text with the obtained or fallback value - modifiedText = modifiedText.replace(recallInfo, value || fallback); + modifiedText = modifiedText.replace(recallInfo, value?.toString() || fallback); } return modifiedText;