/* * JavaScript functions for Survey123 */ function replaceNoissue (pole_cond) { // const issues = [pole_cond] const issuesString = issues.join (', '); const regexList = [/choice_1/,/choice_2/,/choice_3/,/choice_4/]; const newStr = regexList.some(rx => rx.test(issuesString)); if (newStr == true) { var output = issuesString.replace('no_issue',' '); } else { var output = issuesString } return(output) }