AutoForm "Match Failed" - why?


#1

I’m not sure what I’m doing wrong, but when I hit submit, I’m getting a Match error.

Here’s the relevant code for the field that might be causing trouble:

{{> afQuickField name="interestedIn" options=products noselect=true}}

Schema block:

  interestedIn: {
    type: [String],
    label: 'Which products are you interested in?',
    optional: true
  },

Helper:

Template.signup.helpers({
  products: function () {
    return Products.find().fetch().map(function (p) {
      return {label: p.name, value: p.name};
    });
  }
});

#2

I think the Match error is coming from type: [String], try removing it from [] and see if that works.

    type: String,
    label: 'Which products are you interested in?',
    optional: true
  },```

Also there might be a better way to query your Products collection. 
I would look into that as well.

#3

Oddly, it fixed itself. I don’t even know what the culprit was. Very strange!