cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Skitzer1985
Frequent Visitor

Validating a Barcode using part of the Output String

Hi,

 

Hoping someone can point me in the right direction. My current job is creating a Work Tracking system, using QR codes to track jobs, but once in a while we will get a false scan using the barcode scanner feature. I was wondering if anyone could point me in the direction on how, using the first part of the QR string, Check if 3 letters are there to proceed with the scan. I thought maybe a 

 

If(Left(BarcodeScanner1.Value,3,"Value",
Set(
variable,
Patch(

 

and so forth for my patch to Sharepoint.

 

Any help would be greatly appreciated. 

3 REPLIES 3
WarrenBelz
Super User
Super User

Hi @Skitzer1985 ,

Are you trying to confirm the first three characters are letters (not numbers)

With(
   {wAlpha:Left(BarcodeScanner1.Value,3)},
   If(
      Value(First(wAlpha) = 0 &&
      Value(Last(wAlpha) = 0 &&
      Value(Last(FirstN(wAlpha,2)) = 0,
      Set(
         variable,
         Patch( 
         . . . .
         )
      )
   )
)   

 

Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

Visit my blog Practical Power Apps

Skitzer1985
Frequent Visitor

Hi @WarrenBelz ,

 

Thanks for the quick response, I was able to do the Validation of the QR using this:

 

//Write Recorded Data Back to Sharepoint
//Top Line authenticates that the first 3 Letters Match String (ASM) to ensure the tag is correct
If(
    Left(
        VarScan,
        3
    ) = "ASM",
    ( 
//If ASM tag is present, Will create Record in Sharepoint
 Set(
        varRecord,
        Patch(

 

By the way, thanks for your help on other posts, it's help immensely

 

Skitzer1985 

 

Hi @Skitzer1985 ,

If you had told me the value had to be "ASM" rather than Check if 3 letters are there, my response would have been pretty much what you have  . . .

Helpful resources

Announcements
Microsoft 365 Conference – December 6-8, 2022

Microsoft 365 Conference – December 6-8, 2022

Join us in Las Vegas to experience community, incredible learning opportunities, and connections that will help grow skills, know-how, and more.

Top Solution Authors
Top Kudoed Authors
Users online (1,290)