Scanning 2 Barcodes from 1 App

Hello @gio
What to do if I have scan two different barcodes in the same app. How do I store two different sets of barcode values?

hello @Krish, that’s a great question. do you have something to identify each of these barcodes with?? for example, do some always start with a specific pattern of numbers or text??

if so, you could use logic similar to this:


in this example, if the scanned barcode starts with a PART_#, it’ll be stored in the Part Number Variable, else it’ll be stored in the Assembly Number Variable.

let me know if we correctly understood your question!!

Hello @gio

We use the same barcode label that starts with the same Text. In that case , does the solution proposed by you work ?

I tried it in this way, but , what happens is the same barcode gets entered twice. Which I dont want.

hey @Krish, you’ll want to separate out the Actions of storing the different Variables into two separate If/Then blocks if you want to store the Variables separately. if you include many Actions in one If/Then block, they will all execute once the conditional statement is met.

if they both start with the same text, that solution will not work unfortunately.

do you have another way of identifying Work Orders vs. the other item you’d like to scan?? are they for example of different lengths?? if so, you could use a RegEx to identify which part is being scanned.

Hello @gio ,

The work order is something that is generated in our ERP system . When it comes to the length I can say that the work order and the barcode of the item I need to scan are of different length. If this is the case , should I make use of RegEx ?

Hello @gio

Is this right way to do it ?

hello @Krish, in that case you could indeed use a RegEx to check for the length of what’s being scanned. in this example, if the length is 5 it will be stored as Part and if its length is 9 it will be stored as Work Order:

Regular Expression (you can modify the 5 in the {} to the length you’d like): /^[a-zA-Z0-9]{5}$/

did I correctly understand what you were mentioning?? thanks!!

Yes, this clears my doubt. Thanks!

I have another doubt. Is it possible to scan and enter two barcode in the same app. For example, I have a work order and an item with a bar code, I need to scan both of these in the same step and enter them in the same table simultaneously. Is it possible to do it in Tulip ?

Or I would have to create two different steps and scan them separately.

no problem, great to hear @Krish!!

you can certainly have both barcode scans in the same Step. using the above shared logic (and combining multiple Actions in the Trigger), you can perform as many Actions as needed on every Barcode Scan:

would you have time tomorrow at 11AM EST?? we can review these together in Office Hours if it would be useful!!

@gio yeah sure , I’m available tomorrow around 11.30 am EST.

Does that work for you ?

I’ll be available until 12PM, I have just sent you an invite. speak then!!

@gio ok see you then. Thanks !

1 Like

Hello @gio,

I tested the app , after our meeting. What happens is , only one of the barcode is entered in the table (the item no. barcode), the other one isn’t entered (work order no.). Do I need to change anything in the app ?

Thanks,
Eswar.

hey @Krish, OK sorry to hear about this challenge - what is it that you’re experiencing when you scan the Work Order barcode?? I suspect that the initial characters may not match between what’s being scanned and the information the barcode contains if the first one works correctly.

adding a separate Trigger to only display the Barcode Value can be a useful technique to view what is being scanned and so you can adjust the logic accordingly (this example is for an Optical Barcode, you may need to change to physical barcode scanner if that’s what’s being used):

hope this helps!!

Hello @gio,


When I scan the work order barcode, it gets scanned but the value isn’t stored in the table as shown in the image.

Thanks,
Eswar

@Krish, OK could you remove the If Condition, which was similar to this one:


in the second block If/Then block that was added??

Hello @gio,

The app works !! Thanks for the help.

that’s great to hear @Krish!! it would awesome if you could share what you’re building in Show and tell - Tulip Community.

@gio Sure.

Also, I have been trying to access the Traceability tutorial in Tulip but haven’t been able to access it. Could you kindly help me with pls.