diff --git a/src/eq_schema/builders/routing2/newRoutingDestination/index.js b/src/eq_schema/builders/routing2/newRoutingDestination/index.js index 6a949767..0d541398 100644 --- a/src/eq_schema/builders/routing2/newRoutingDestination/index.js +++ b/src/eq_schema/builders/routing2/newRoutingDestination/index.js @@ -27,9 +27,10 @@ const getOptionValues = (optionIds, questionnaire) => { const optionResults = optionIds.map((id) => { const option = find(options, { id }); - const optionContent = option.value - ? option.value.trim() - : option.label.trim(); + const optionContent = + questionnaire.dataVersion === "3" && option.value + ? option.value.trim() + : option.label.trim(); const updatedContent = optionContent .replace(/'/g, `\u2019`) diff --git a/src/eq_schema/schema/Answer/index.js b/src/eq_schema/schema/Answer/index.js index 66fcf606..8e535b1f 100644 --- a/src/eq_schema/schema/Answer/index.js +++ b/src/eq_schema/schema/Answer/index.js @@ -252,7 +252,8 @@ class Answer { { properties, type }, ctx ) { - const optionValue = value ? value : label; + const optionValue = + ctx && ctx.questionnaireJson.dataVersion === "3" && value ? value : label; const option = { label: buildContents(label, ctx, true), value: buildContents(optionValue, ctx, true),