Filtering based on character count | Community
Skip to main content
Micaela_Wright
New Participant
August 22, 2017
Solved

Filtering based on character count

  • August 22, 2017
  • 1 reply
  • 2231 views

We'd like to do some filtering based on the character count of a field. For example, a person on our website fills out a form. If the "details" field is less than 10 characters, they are not qualified to talk to our sale team. We'd like to route it to support instead. Is there a way to do this within Marketo? Ideally we could do this using an "Add Choice" step.

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by SanfordWhiteman

Natively in a Smart List, no. But on the form side, sure:

MktoForms2.whenReady(function(form){

  form.onSubmit(function(form){

    form.addHiddenFields({

      meetsMinDetails : form.getValues().Details.length >= 10 ? 'yes' : 'no'

    });

  });

});

(meetsMinDetails is a Boolean field in your instance.)

Or you could use a webhook on the server to check.

You could also set a min/max on a textarea field itself, but that might telegraph your rules too much. You want the person to organically have more to say.

1 reply

SanfordWhiteman
SanfordWhitemanAccepted solution
New Participant
August 22, 2017

Natively in a Smart List, no. But on the form side, sure:

MktoForms2.whenReady(function(form){

  form.onSubmit(function(form){

    form.addHiddenFields({

      meetsMinDetails : form.getValues().Details.length >= 10 ? 'yes' : 'no'

    });

  });

});

(meetsMinDetails is a Boolean field in your instance.)

Or you could use a webhook on the server to check.

You could also set a min/max on a textarea field itself, but that might telegraph your rules too much. You want the person to organically have more to say.