Hi All, I wrote a JavaScript function to return a string list of unique values from responses within a repeat. The idea is to present the user with summary information that they can review prior to form submission. The JS function takes a sum of repeat responses as a concatenated string and returns a string with only the unique values. Everything works fine locally but when I publish the survey, I get NaN returned from the function.
Here is my function that I have tested in the script editor and verified that it works in Connect.
function getUniqueValString(inputStringArray){
// convert to array without the comma at the end and filter unique using index then mash back into a string to show user
let inputArray = inputStringArray.slice(0, -1).split('*');
const uniqueValues = inputArray.filter((item, idx) => inputArray.indexOf(item) === idx);
return uniqueValues.join('<br>');
}The function works as expected in Connect but not in the webform as shown in the screenshot attached. Any thoughts?