Reply To: Having trouble with uploading .csv files

PennController for IBEX Forums Support Having trouble with uploading .csv files Reply To: Having trouble with uploading .csv files

#6636
Jeremy
Keymaster

Dear Ana,

You have these two lines in your code (PennController. prefix removed):

Template( GetTable("master_spr.csv")
                         .filter("type" , ("critical", "filler"))

The filter command can only take one string or one regular expression as its second argument. In your case, you could use the regular expression /^(critical|filler)$/

Note that grouping a pair of strings in parentheses the way you did is not standard JavaScript syntax. I was surprised that that bit of code did not throw an error, and I had to do some testing to understand how JavaScript processes those parenthesis entities. It seems that it systematically returns the last member only, so in your case it would simply return "filler", which would explain why you end up with 80 items (there are exactly 80 fillers in your table).

Jeremy