You are viewing limited content. For full access, please sign in.

Question

Question

Leading Zeros being lost when Form submitted

asked on November 2, 2016

We have a form that was created under 9.2, we have moved to version 10.1 last week.   There is a number field for the employee ID.   Some are 2 numbers: 59, some are 3 numbers 191, some are 4: 1511.  In the field we instructed everyone to use 0059, 0191 and 1511  so the lookups will work.  In Forms this  lookup still seems to work - HOWEVER when the FORM is submitted the number put in the FORMS database seems to lose the leading zeros and the corresponding workflow that use these 2 or 3 digit fail.

When I look at the tokens in the failed Workflows - the employee id does not  have the leading zeros.   When I test the query with the id showing in the tokens the lookup fails, when I add the leading zeros the query works.   When a employee with a 4 digit ID runs the FORM and the attached Workflow the query is successful.

The query in Workflow is a simple lookup - not a custom query.   How do I get FORMS to save all 4 digits including the leading zeros in it's database?  OR how do I get workflow to add leading zeros to the simple lookup?  OR am I going to  have to change the query to a custom query to add in the leading zeros?

Any help would be appreciated.   Thanks.

 

 

0 0

Answer

SELECTED ANSWER
replied on November 3, 2016

Thanks for getting back so quickly, we tried both answers and they failed but it started me down the right path.   What I tried next was: I created a token using the variable WorkFlow gets from Forms and then using the Apply Formatting I put in D4-so no matter what number was in the variable the token would make it a 4 digit number.   I then used the token in the query.   So far this seems to be working-the query is successfully  running in all the tests we've done.   

3 0
replied on November 3, 2016

Thanks for letting us know Rebecca. Sorry I didn't have a 100% correct answer for you right from the start, but I'm glad to hear you got it sorted out.

0 0

Replies

replied on November 2, 2016

My best guess from your description is that originally it was treating those fields as text fields, but now they are being treated as number fields. You need to force it to treat those submissions as text, and not integers. No matter what program you use, if something like 0025 is submitted as an integer, it'll change to 25.

It was 9.2 that was being aberrant if you had a number field submitting 0025 as 0025.

Make the field a single line, and then edit it and go to the advanced setting and put \d\d\d\d for the "Regular Expression for Validation"

3 0
replied on November 2, 2016

Have you tried putting a constriction on the field requiring 4 digits?

0 0
You are not allowed to follow up in this post.

Sign in to reply to this post.