diff --git a/packages/report-server/src/aggregator/ReportServerAggregator.ts b/packages/report-server/src/aggregator/ReportServerAggregator.ts index d44f9c16d5..602c5f44d8 100644 --- a/packages/report-server/src/aggregator/ReportServerAggregator.ts +++ b/packages/report-server/src/aggregator/ReportServerAggregator.ts @@ -95,7 +95,8 @@ export class ReportServerAggregator { .of( yup.object().shape({ code: yup.string().required(), - text: yup.string().required(), + text: yup.string(), + name: yup.string(), }), ) .required(), diff --git a/packages/report-server/src/reportBuilder/output/functions/rawDataExport/rawDataExportBuilder.ts b/packages/report-server/src/reportBuilder/output/functions/rawDataExport/rawDataExportBuilder.ts index bf3ccad7f7..76d21ae229 100644 --- a/packages/report-server/src/reportBuilder/output/functions/rawDataExport/rawDataExportBuilder.ts +++ b/packages/report-server/src/reportBuilder/output/functions/rawDataExport/rawDataExportBuilder.ts @@ -50,7 +50,7 @@ export class RawDataExportBuilder { const { dataElements } = await this.aggregator.fetchDataGroup(surveyCode); return dataElements.map(dataElement => ({ key: dataElement.code, - title: dataElement.text, + title: dataElement.text || dataElement.name || '', })); }), )