diff --git a/TableauConnector.php b/TableauConnector.php index 4036da5..4a68e45 100644 --- a/TableauConnector.php +++ b/TableauConnector.php @@ -375,7 +375,7 @@ function getCheckboxChoiceLabel($response, rcExportVarname) { var choiceOptionString = $response.find( 'CodeList[OID="'+rcExportVarname+'.choices"]' ).attr('redcap:CheckboxChoices'); var choiceVarVal = rcExportVarname.split('___'); var choiceLabel = choiceVarVal; - choiceOptionString.split(' | ').forEach(function(c) { + choiceOptionString.split(/\s*\|\s*/g).forEach(function(c) { if (c.lastIndexOf(choiceVarVal[1]+', ', 0)===0) { // if (c.startsWith(choiceVarVal[1]+', ')) { // do not use startsWith() ! choiceLabel = c.replace(choiceVarVal[1]+', ', ''); }