cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Joha2401
New Member

Barcode Scanner: If, Then, Set

Hello, I have a question about the barcode scanner. I would like to use the app to capture a number of identical barcodes. Accordingly, +1 should be added to a variable for a certain barcode.

 

In simple terms it should do the following:

If (BarcodeA detected) then Set (VariableA +1);; If (BarcodeB detected) then Set (VariableB +1)...

 

Unfortunately, I am not making any progress with the implementation.

 

Thanks for your help

1 ACCEPTED SOLUTION

Accepted Solutions
v-xida-msft
Community Support
Community Support

Hi @Joha2401 ,

Based on the needs that you mentioned, I think the OnScan property of the Barcode scanner control to following:

If(
   BarcodeScanner1.Value = "BarcodeA",
   Set(VariableA, VariableA + 1),
   BarcodeScanner1.Value = "BarcodeB",
   Set(VariableB, VariableB + 1),
   BarcodeScanner1.Value = "BarcodeC",
   Set(VariableC, VariableC + 1),
   ....
)

 

On your side, you may use ';' as List separator instead of ',' (comma), please modify above formula as below:

If(
   BarcodeScanner1.Value = "BarcodeA";
   Set(VariableA; VariableA + 1);
   BarcodeScanner1.Value = "BarcodeB";
   Set(VariableB; VariableB + 1);
   BarcodeScanner1.Value = "BarcodeC";
   Set(VariableC; VariableC + 1);
   ....
)

 

Please consider take a try with above solution, check if the issue is solved.

 

Best regards,

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

2 REPLIES 2
seanbrogan
Advocate V
Advocate V

You could try setting variables to zero when the app loads, then add 1 each time.

 

So in the OnStart property of the app put

 

Set(VariableA,0)

 

Then in your barcode formula put

 

Set(VariableA,VariableA+1)

v-xida-msft
Community Support
Community Support

Hi @Joha2401 ,

Based on the needs that you mentioned, I think the OnScan property of the Barcode scanner control to following:

If(
   BarcodeScanner1.Value = "BarcodeA",
   Set(VariableA, VariableA + 1),
   BarcodeScanner1.Value = "BarcodeB",
   Set(VariableB, VariableB + 1),
   BarcodeScanner1.Value = "BarcodeC",
   Set(VariableC, VariableC + 1),
   ....
)

 

On your side, you may use ';' as List separator instead of ',' (comma), please modify above formula as below:

If(
   BarcodeScanner1.Value = "BarcodeA";
   Set(VariableA; VariableA + 1);
   BarcodeScanner1.Value = "BarcodeB";
   Set(VariableB; VariableB + 1);
   BarcodeScanner1.Value = "BarcodeC";
   Set(VariableC; VariableC + 1);
   ....
)

 

Please consider take a try with above solution, check if the issue is solved.

 

Best regards,

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

Helpful resources

Announcements
PA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

MBAS Attendee Badge

Claim Your Badge & Digital Swag!

Check out how to claim yours today!

secondImage

Are Your Ready?

Test your skills now with the Cloud Skill Challenge.

Top Solution Authors
Top Kudoed Authors
Users online (80,829)