Search code examples
javascriptbeacon

Beacon prefill function


I already set up the Beacon 'identify' stuffs, and can open up using Beacon("open");

But when I try to use prefill function, i'm getting some error.

Beacon("prefill", {
    name: "Steve Aoki",
    email: "[email protected]",
    subject: "Need help with invoice",
    text: "Hello, I need some help with my invoice. See attached.."
})

Error: Uncaught TypeError: Cannot read property 'filter' of undefined Any code that I missed? Thanks in advance.

Reference here


Solution

  • You need to have a fields array, because in the example you posted, the one thing your code doesn't have is a fields array. This is also shown because filter is an array method, and calling fields.filter when you don't have fields will result in an undefined error.