How do we collect telephone numbers which start with a leading zero?

We want to link the secondary number to the momo number such that when the respondent types the secondary number as the momo number it will show an error if it’s not the exact number. We have done it for the primary number but we’re are having difficulty merging in the secondary number as well

In this case put the contact number in the constraint_message. It should solve your issue.

Kindly provide details about the constraint message. Thanks

Please see the image of the constraint message as shared in the post shared above.

Please can’t see the image you talking about

OK, maybe you could follow this post to see how to reference a value used previously in a constraint_message:

Hello, so the formula given for this solution is no longer working. What can be done to resolve this?


Hi @ekua
Could you try this out regex(., ‘^(0)[0-9]{9}$’)
This works out perfectly from my end.

Stephane

1 Like

@ekua, could you also look at the question type? It should not be in integer. Instead it should be in text with an appearance as numbers.

Thank you, it’s working now

1 Like

Hello. The appearance setting in my own question type does not have a drop down. It is open-ended. What do I put in there please?

Hello. The appearance setting in my own question type does not have a drop down. It is open-ended. What do I put in there please?

You could simply type in numbers.

Thank you so much…

1 Like

Hello @stephanealoo @Kal_Lam I have a problem. This regex code is working. The appearance is number and I can type more than 11 digits. But I can move to the next question. The response is whatever I inputted in the Error message box or invalid number.

Hi @ife welcome back to the community.

Can you share a screenshot of the issue?

Best,

1 Like

Hi @ife,

I am counting 10 digits after 0 in your screenshot, if that’s the case you want to use can you try this code:

regex(., ‘^(0)[0-9]{10}$’)

Let’s see if that works.

1 Like