# Using Quotas to Restrict response by postal code

1 year 5 months ago - 1 year 5 months ago #148660 by blocka
blocka created the topic: Using Quotas to Restrict response by postal code
I have a scenario where I want to prevent people from completing a survey if they aren't in a range of postal codes.

For example:

- a single postal code value (like A1A),
and/or
- a series of ranges (like K1A, M3B, V5C, etc.)

I know I can't use a short text in a Quota, but I think there should be a way to create a hidden question of type "Yes/No", that validates the postal code field to check if it (a) matches a single prefix or (2) a series of prefixes...

If the postal code isn't in my valid list, then the response to the Yes/No question is set to "N" -- and then I can use quotas to terminate the survey for respondents where the Y/N question is equal to "N".

I'm wondering if someone can provide me with a working example of how to set this up or suggest another way do this?
Last Edit: 1 year 5 months ago by blocka.

Please Log in or Create an account to join the conversation.

1 year 5 months ago #148664 by Joffm
Joffm replied the topic: Using Quotas to Restrict response by postal code
Hi, blocka,
Create an equation which sets your "valuation value".
Like {if(postalcode=="A1A",1,if(postalcode=="C3S",1,if(postalcode=="K4D",1,0)))}

Now you have your numerical value where you can set a quota.

Not a working example, but you know the way.

Best regards
Joffm

Volunteers are not paid.
Not because they are worthless, but because they are priceless

Please Log in or Create an account to join the conversation.

1 year 5 months ago #148671 by blocka
blocka replied the topic: Using Quotas to Restrict response by postal code
I've been able to implement this, and I've attached it as an example for anyone else who is trying to accomplish something like this (as I couldn't find an example on the forums).

My example shows how you can create a text question, and a Yes/No question, and an equation request, and use the equation question to inspect the text question, and assign either Yes or No to the Yes/No question.

These 3 questions are in my first Question Group. A second question group contains a few silly questions... And a quota has been implemented to terminate the survey if the value of my Yes/No question is No.

So, if you enter a valid postal code A1A, C3S, or K4D then you'll see the 2nd question group -- else the Quota kicks in, and terminates the survey with a friendly message.
##### Attachments:

Please Log in or Create an account to join the conversation.

1 year 5 months ago #148674 by jelo
jelo replied the topic: Using Quotas to Restrict response by postal code

Joffm wrote: Now you have your numerical value where you can set a quota.
Not a working example, but you know the way.

Are equation questions now accessible in the quota system?
I always needed a proxy question, which was set via Javascript or EM.

Please Log in or Create an account to join the conversation.

1 year 5 months ago - 1 year 5 months ago #148695 by Joffm
Joffm replied the topic: Using Quotas to Restrict response by postal code
Hi, Jelo,
okay, I did not mention that, because I thought, it's obvious.

You have to assign the equation value to a hidden question that supports quotas.

Like: {Test2=if(equation1==1,1,2)}

And blocka did it this way - assigning the equation value to a "Y/N" question.

Best regards
Joffm

Volunteers are not paid.
Not because they are worthless, but because they are priceless
Last Edit: 1 year 5 months ago by Joffm. Reason: Typo

Please Log in or Create an account to join the conversation.