Customer form for existing email shows 'note is invalid' error

We have a standard Shopify customer form {% form 'customer' %} that is submitting email input as well as a custom note field:

<input class="form__input"
  id="{{- form_id -}}-{{- input_name -}}"
  type="text"
  name="contact[note][{{- input_name -}}]"
  value=""
>

If the form is submitted by a customer who already has an account, we receive an error from Shopify in {% form.errors %} that says “note is invalid”:

What we’ve seen in docs: [note] is allowed on the create_customer form and shown in the example here: Collect additional customer information

There’s no mention of it in the email customer form discussed here, whether it’s allowed or not: Email consent

The form submit does add a note correctly to a newly created customer. We’re trying to figure why adding a note is showing an error for an existing customer, when other fields (like email) don’t give an error – and if there’s any fix?

Hi Jwern,

The rules for the customer sign up form may be different than the newsletter form, which is why you’re not seeing mention of the note attribute on the docs for the newsletter. I’m thinking since the newsletter doesn’t truly create a customer, only creates an entry with the email address without other details, the note wouldn’t be supported.

It looks like the note can’t be added on a customer registration form if the customer already exists - ie: this form only creates a new customer, but it doesn’t update an existing customer.

Could you use a newsletter sign up form instead and add a custom field that would save the note as a tag on the customer (see this post with a description of this)?

Otherwise you could check what apps are available for updating existing customer accounts.

Hi Liam,

Thank you so much for responding and providing some insight! Your suggested workaround looks interesting and like it could be helpful when we really need the note data in some format. Honestly in this particular case the note field isn’t critical for having in Shopify, as we are passing it along to a 3rd party.

I am still curious about the discrepancy between the note field throwing an error but the email field not:

  • When the customer / email doesn’t exist in Shopify and we have a note field: the customer is created and the note field is added correctly.
  • When the customer / email exists in Shopify and we don’t have a note field: the form does not show the success state and no error is thrown.
  • When the customer / email exists in Shopify and we do have a note field: the form does not show the success state but an error is thrown.

It feels like the note field shouldn’t cause an error to appear since “customer / email already exists” doesn’t throw an error. (Or vice versa – if the note field is worth throwing an error for, shouldn’t the email field also?) In this case we’d be okay with the note not actually updating, but the error appearing is causing some confusion.