SOLVED

Filtering based on character count

Go to solution
Micaela_Wright
Level 3

Filtering based on character count

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.

1 ACCEPTED SOLUTION

Accepted Solutions
SanfordWhiteman
Level 10 - Community Moderator

Re: Filtering based on character count

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.

View solution in original post

1 REPLY 1
SanfordWhiteman
Level 10 - Community Moderator

Re: Filtering based on character count

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.