cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
PJS-Data-Admin
Helper I
Helper I

If Barcode Scan doesn't contain certain text formula

Hello All,

 

I cannot figure out the formula for a barcode scanning app I have created. Each barcode has a "|" inside of the QR code which is used later in the app to split the text by before the "|" and after the "|".

 

My goal it to make it so that employees cannot scan a barcode unless it contains the "|". (Since all of our barcodes will contain the "I") If the barcode does contain the "|" then: 

Set(_popup,true);UpdateContext({timestamp: Text(Now(),"yyyy-mm-dd hh:mm:ss.sss")});

If it doesn't then:

Navigate(InvalidBarcodeScanScreen)

 

Thank you for any assistance!

 

1 ACCEPTED SOLUTION

Accepted Solutions

@Nogueira1306 

Thank you! I was able to get this to work with the following formula: 

 

If("|" in BarcodeScanner.Value, Set(_popup,true), Navigate(InvalidScreen))

 

 

 

View solution in original post

5 REPLIES 5
RandyHayes
Super User
Super User

@PJS-Data-Admin 

A couple ways to get about this...

One option is to place a hidden toggle on your screen and set the Default property formula to the following:

   !IsBlank(yourBarCodeScanner.Value) && !("|" in yourBarCodeScanner.Value)

Then set the OnCheck action of the toggle to:

Navigate(InvalidBarcodeScanScreen)

 

You could use the same (but opposite) approach for the popup and reduce the use of the variable.

 

I hope this is helpful for you.

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!
Nogueira1306
Community Champion
Community Champion

Hey! Take a look at this function

 

https://docs.microsoft.com/en-us/powerapps/maker/canvas-apps/functions/function-find 

 

If you find the "|", Go ahead, if not, navigate to invalid

 

If you need additional help please tag me in your reply and please like my reply.
If my reply provided you with a solution, pleased mark it as a solution ✔️!

Best regards,
Gonçalo Nogueira

Check my LinkedIn! 

@Nogueira1306 @RandyHayes 

 

Thank you for the response, this needs to be built in to the "OnScan" for my "BarcodeScanner", can these methods work in that location? Could you provide an example?

Yes. You need to witn them on  Onscan property 

 

If you need additional help please tag me in your reply and please like my reply.
If my reply provided you with a solution, pleased mark it as a solution ✔️!

Best regards,
Gonçalo Nogueira

Check my LinkedIn!

@Nogueira1306 

Thank you! I was able to get this to work with the following formula: 

 

If("|" in BarcodeScanner.Value, Set(_popup,true), Navigate(InvalidScreen))

 

 

 

View solution in original post

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

M365 768x460.jpg

Microsoft 365 Collaboration Conference | December 7–9, 2021

Join us, in-person, December 7–9 in Las Vegas, for the largest gathering of the Microsoft community in the world.

Top Solution Authors
Top Kudoed Authors
Users online (3,227)