Skip to content

Commit

Permalink
Exclude null values from geopackage export checkbox question answers
Browse files Browse the repository at this point in the history
  • Loading branch information
mmoila committed May 6, 2024
1 parent 462743c commit 331438d
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions server/src/application/answer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,7 @@ function dbEntriesToFeatures(
) {
submissionGroup[submissionId][answer.parentEntryId].properties[
questionKey
] = null;
] = false;
}
});
// initialize subquestion custom answer header if it exists
Expand Down Expand Up @@ -814,7 +814,14 @@ function createCSVHeaders(sectionMetadata: SectionHeader[]) {
// numeric, free-text, slider
default:
allHeaders.push({
[getHeaderKey(sectionHead.pageIndex, sectionHead.sectionIndex, null, null, sectionHead.predecessorSection, predecessorIndexes)]:
[getHeaderKey(
sectionHead.pageIndex,
sectionHead.sectionIndex,
null,
null,
sectionHead.predecessorSection,
predecessorIndexes,
)]:
`${getSectionDetailsForHeader(
sectionHead,
predecessorIndexes,
Expand Down Expand Up @@ -997,7 +1004,7 @@ function getValue(answer: AnswerEntry, answerType: string) {
case 'numeric':
return answer.valueNumeric;
case 'free-text':
return answer.valueText.replace(/\r?\n/g, "").replace(/,/g, '');
return answer.valueText.replace(/\r?\n/g, '').replace(/,/g, '');
}
}

Expand Down

0 comments on commit 331438d

Please sign in to comment.