Hello. Is there a way to add a constraint so that the first letter is
evaluated?
For example.
I have a barcode that has labels that start with P and labels that
start with S. I want to make sure for a particular variable they scan
the right barcode. I tried to edit the XML and add:
constraints are only evaluated on the swipe to the next screen. also,
your xml isn't correct. you have to do something like this...
note that the regex command has to go inside the constraint attribute.
yaw
ยทยทยท
On Thu, Jun 16, 2011 at 18:12, Alex Pavluck wrote:
> Hello. Is there a way to add a constraint so that the first letter is
> evaluated?
>
> For example.
> I have a barcode that has labels that start with P and labels that
> start with S. I want to make sure for a particular variable they scan
> the right barcode. I tried to edit the XML and add:
>
> regex="^P"/>
>
> But, it didn;t stop me from scanning a S barcode.
>
>
> Thanks!!!
>
> --
> Post: opendatakit@googlegroups.com
> Unsubscribe: opendatakit+unsubscribe@googlegroups.com
> Options: http://groups.google.com/group/opendatakit?hl=en
>
I want to make sure the barcode starts with a P and then there is
either 6 numbers or a second letter and 5 numbers.
ex.
P123456
or
PZ12345
ยทยทยท
On Jun 16, 3:45 pm, Yaw Anokwa wrote:
> hi alex,
>
> constraints are only evaluated on the swipe to the next screen. also,
> your xml isn't correct. you have to do something like this...
>
> constraint="regex(.,
> '[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,4}')"
> jr:constraintMsg="this isn't a valid email address"/>
>
> note that the regex command has to go inside the constraint attribute.
>
> yaw
>
>
>
>
>
>
>
> On Thu, Jun 16, 2011 at 18:12, Alex Pavluck wrote:
> > Hello. Is there a way to add a constraint so that the first letter is
> > evaluated?
>
> > For example.
> > I have a barcode that has labels that start with P and labels that
> > start with S. I want to make sure for a particular variable they scan
> > the right barcode. I tried to edit the XML and add:
>
> > > regex="^P"/>
>
> > But, it didn;t stop me from scanning a S barcode.
>
> > Thanks!!!
>
> > --
> > Post: opendatakit@googlegroups.com
> > Unsubscribe: opendatakit+unsubscribe@googlegroups.com
> > Options:http://groups.google.com/group/opendatakit?hl=en
ยทยทยท
On Wed, Jun 22, 2011 at 13:43, Alex Pavluck wrote:
> Thanks, Yaw.
>
> So, is this syntax correct:
>
> constraint="regex(.,
> '^P\.\d\d\d\d\d\"
> jr:constraintMsg="Person ID must begin with a P"/>
>
> I want to make sure the barcode starts with a P and then there is
> either 6 numbers or a second letter and 5 numbers.
>
> ex.
> P123456
> or
> PZ12345
>
>
>
> On Jun 16, 3:45 pm, Yaw Anokwa wrote:
>> hi alex,
>>
>> constraints are only evaluated on the swipe to the next screen. also,
>> your xml isn't correct. you have to do something like this...
>>
>> > constraint="regex(.,
>> '[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,4}')"
>> jr:constraintMsg="this isn't a valid email address"/>
>>
>> note that the regex command has to go inside the constraint attribute.
>>
>> yaw
>>
>>
>>
>>
>>
>>
>>
>> On Thu, Jun 16, 2011 at 18:12, Alex Pavluck wrote:
>> > Hello. Is there a way to add a constraint so that the first letter is
>> > evaluated?
>>
>> > For example.
>> > I have a barcode that has labels that start with P and labels that
>> > start with S. I want to make sure for a particular variable they scan
>> > the right barcode. I tried to edit the XML and add:
>>
>> > > > regex="^P"/>
>>
>> > But, it didn;t stop me from scanning a S barcode.
>>
>> > Thanks!!!
>>
>> > --
>> > Post: opendatakit@googlegroups.com
>> > Unsubscribe: opendatakit+unsubscribe@googlegroups.com
>> > Options:http://groups.google.com/group/opendatakit?hl=en
>
> --
> Post: opendatakit@googlegroups.com
> Unsubscribe: opendatakit+unsubscribe@googlegroups.com
> Options: http://groups.google.com/group/opendatakit?hl=en
>
Sorry, I tried the following and it crashes the app after I try to
swipe next:
ยทยทยท
On Jun 22, 2:08 pm, Yaw Anokwa wrote:
> that regex won't work. try
>
> regex(,(P[0-9]{6})|(PZ[0-9]{5}))
>
>
>
>
>
>
>
> On Wed, Jun 22, 2011 at 13:43, Alex Pavluck wrote:
> > Thanks, Yaw.
>
> > So, is this syntax correct:
>
> > > constraint="regex(.,
> > '^P\.\d\d\d\d\d\"
> > jr:constraintMsg="Person ID must begin with a P"/>
>
> > I want to make sure the barcode starts with a P and then there is
> > either 6 numbers or a second letter and 5 numbers.
>
> > ex.
> > P123456
> > or
> > PZ12345
>
> > On Jun 16, 3:45 pm, Yaw Anokwa wrote:
> >> hi alex,
>
> >> constraints are only evaluated on the swipe to the next screen. also,
> >> your xml isn't correct. you have to do something like this...
>
> >> >> constraint="regex(.,
> >> '[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,4}')"
> >> jr:constraintMsg="this isn't a valid email address"/>
>
> >> note that the regex command has to go inside the constraint attribute.
>
> >> yaw
>
> >> On Thu, Jun 16, 2011 at 18:12, Alex Pavluck wrote:
> >> > Hello. Is there a way to add a constraint so that the first letter is
> >> > evaluated?
>
> >> > For example.
> >> > I have a barcode that has labels that start with P and labels that
> >> > start with S. I want to make sure for a particular variable they scan
> >> > the right barcode. I tried to edit the XML and add:
>
> >> > >> > regex="^P"/>
>
> >> > But, it didn;t stop me from scanning a S barcode.
>
> >> > Thanks!!!
>
> >> > --
> >> > Post: opendatakit@googlegroups.com
> >> > Unsubscribe: opendatakit+unsubscribe@googlegroups.com
> >> > Options:http://groups.google.com/group/opendatakit?hl=en
>
> > --
> > Post: opendatakit@googlegroups.com
> > Unsubscribe: opendatakit+unsubscribe@googlegroups.com
> > Options:http://groups.google.com/group/opendatakit?hl=en
ยทยทยท
On Wed, Jun 22, 2011 at 15:20, Alex Pavluck wrote:
> Sorry, I tried the following and it crashes the app after I try to
> swipe next:
>
> constraint="regex(',(P[0-9]{6})|(PZ[0-9]{5})')"/>
>
>
>
> On Jun 22, 2:08 pm, Yaw Anokwa wrote:
>> that regex won't work. try
>>
>> regex(,(P[0-9]{6})|(PZ[0-9]{5}))
>>
>>
>>
>>
>>
>>
>>
>> On Wed, Jun 22, 2011 at 13:43, Alex Pavluck wrote:
>> > Thanks, Yaw.
>>
>> > So, is this syntax correct:
>>
>> > > > constraint="regex(.,
>> > '^P\.\d\d\d\d\d\"
>> > jr:constraintMsg="Person ID must begin with a P"/>
>>
>> > I want to make sure the barcode starts with a P and then there is
>> > either 6 numbers or a second letter and 5 numbers.
>>
>> > ex.
>> > P123456
>> > or
>> > PZ12345
>>
>> > On Jun 16, 3:45 pm, Yaw Anokwa wrote:
>> >> hi alex,
>>
>> >> constraints are only evaluated on the swipe to the next screen. also,
>> >> your xml isn't correct. you have to do something like this...
>>
>> >> > >> constraint="regex(.,
>> >> '[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,4}')"
>> >> jr:constraintMsg="this isn't a valid email address"/>
>>
>> >> note that the regex command has to go inside the constraint attribute.
>>
>> >> yaw
>>
>> >> On Thu, Jun 16, 2011 at 18:12, Alex Pavluck wrote:
>> >> > Hello. Is there a way to add a constraint so that the first letter is
>> >> > evaluated?
>>
>> >> > For example.
>> >> > I have a barcode that has labels that start with P and labels that
>> >> > start with S. I want to make sure for a particular variable they scan
>> >> > the right barcode. I tried to edit the XML and add:
>>
>> >> > > >> > regex="^P"/>
>>
>> >> > But, it didn;t stop me from scanning a S barcode.
>>
>> >> > Thanks!!!
>>
>> >> > --
>> >> > Post: opendatakit@googlegroups.com
>> >> > Unsubscribe: opendatakit+unsubscribe@googlegroups.com
>> >> > Options:http://groups.google.com/group/opendatakit?hl=en
>>
>> > --
>> > Post: opendatakit@googlegroups.com
>> > Unsubscribe: opendatakit+unsubscribe@googlegroups.com
>> > Options:http://groups.google.com/group/opendatakit?hl=en
>
> --
> Post: opendatakit@googlegroups.com
> Unsubscribe: opendatakit+unsubscribe@googlegroups.com
> Options: http://groups.google.com/group/opendatakit?hl=en
>
Is the second letter always going to be a 'Z'? If not then perhaps it should
be constraint="regex(.,'(P[0-9]{6})|(P[A-Z]{1}[0-9]{5})')"/> or something
close to that.
ยทยทยท
On Wed, Jun 22, 2011 at 10:47 PM, Yaw Anokwa wrote:
Hello. Is there a way to add a constraint so that the first letter
is
evaluated?
For example.
I have a barcode that has labels that start with P and labels that
start with S. I want to make sure for a particular variable they
scan
the right barcode. I tried to edit the XML and add:
@yanokwa , I'm not sure if the new barcode reader change is affecting this, but I have noticed that it is picking up barcodes easier, but also scanning erroneous things frequently when the camera is aimed at the ground with forest/grass/etc.
Is there any way/option to apply the constraint so that only those codes that pass the constraint could be physically recognized/scanned by the barcode scanner instead of being evaluated on swipe? This would reduce the frequency of random things being picked up when scanning, but based on previous responses my assumption is that this is far beyond the scope of current barcode plans.
This is with the beta, right? We are working on improvements to this and hope you can try them out once they're ready. We haven't experienced grass being scanned, that's fascinating and not entirely surprising given the current implementation (CC @dbemke, that will be a fun one to verify). We believe we can dramatically reduce the risk of incorrect scans.
This is collect 2025.3.0 Beta 0. Scanning in the ballpark of 200-300 barcodes in the field I probably had about a dozen or slightly less random text that was recognized as a Barcode.
Weโve made some updates in v2025.3.0 beta 2. We now believe the risk of incorrect scans is close to 0. Unfortunately that comes at the cost of some performance loss but itโs still better than before in our testing. Please let us know what you find when you try it out!