setText() text parameter value (undefined) is not a uistring

I am still trying to learn coding so I am not a huge help to my students (yet). I have a senior working on the Hackathon. She keeps getting this:
WARNING: Line: 32: setText() text parameter value (undefined) is not a uistring.
ERROR: Line: 32: TypeError: Cannot read properties of undefined (reading ‘toString’)

I have read through the forum and understand this is a common error and it probably has something to do with the string data type but I don’t know how to help her.

Frequently my students get that error when the filtered list is empty. I looked at your student’s code and they are filtering when ratingList == PASS instead of passList. Adding a watcher for the filtered list helps my students sometimes with problems like this

1 Like

I see the watcher list in the bottom corner. I don’t see it on the remix and I don’t know how it showed on hers, but I did see that there were no names but all the ratings were in the watch list.

the error pertains to how the filter is working, since you have a blank array since no ratings == “PASS” you must use the ratings given to filter it effectively, to avoid this issue you can treat all data with a string constructor or look for if the array is empty and not produce results, additionally when comparing ratings it is important to keep in mind to use ratingsList[i] otherwise you’ll be comparing a string == array which will always be false as well… also to further how wrong this comparison is it isn’t even using the correct data for the pass fail comparison that was desired to fix it just swap this line

// if (ratingList == "PASS") {
// replace with
if (passList[i] == "PASS") {

using this comparison will ensure you don’t have an empty list and undefined does not get passed to the argument since it is expecting a “string” not undefined