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

Barcode Scanner - If Else

Hi, I would like to use the barcode scanner to scan a QR code, fetch data from SQL database for that code and if Value = 1 - show a popup "Yes" or if value = 0 - show a popup "No" - something like that and set a timer to automatically close the popup. The popups can be graphics/images. Any helps is greatly appreciated. Thanks

1 ACCEPTED SOLUTION

Accepted Solutions
mrathi
Frequent Visitor

Stalin, thank you for your response. Currently, I have the below code for OnStart. It basically collects scanned data and then opens up the scanner again. Adding the check if the QR code is in our system or not and doing the popup - will it slow the process? Do you have any suggestions? Thanks!

 

UpdateContext({splashTimer:true});
Collect(OfflineScansToBeAdded,{AttendeeID:expScanner.Value, EventID:var_eventID, SessionID:var_sessionID, ScanDateTime:Now(),DeviceID:var_DeviceID});
SaveData(OfflineScansToBeAdded, "newScansInLocalStorage");
Select(expScanner)

View solution in original post

4 REPLIES 4
StalinPonnusamy
Super User
Super User

Hi @mrathi 

 

Set the OnScan Property of the Barcode Scanner to

Set(ScannedValue, BarcodeScanner1.Text);
Set(SQLOutput, LookUp(Table1, ColumnName = ScannedValue, RetriveColumn));
Set(labelText, If(Value(SQLOutput) = 1, "Yes", "No"));
Set(PopupVisible, true)

 

  • Insert a container - Center of the screen
  • Set the container Visible property to
PopupVisible
  • Select the container and Insert a label within the container
  • Set the text property to
labelText

 

  • Add a Timer control to the screen
  • Set AutoStart to ON
  • Set the timer duration
  • Set OnTimerEnd

 

Set(PopupVisible, false)


Thanks,
Stalin - Learn To Illuminate

mrathi
Frequent Visitor

Stalin, thank you for your response. Currently, I have the below code for OnStart. It basically collects scanned data and then opens up the scanner again. Adding the check if the QR code is in our system or not and doing the popup - will it slow the process? Do you have any suggestions? Thanks!

 

UpdateContext({splashTimer:true});
Collect(OfflineScansToBeAdded,{AttendeeID:expScanner.Value, EventID:var_eventID, SessionID:var_sessionID, ScanDateTime:Now(),DeviceID:var_DeviceID});
SaveData(OfflineScansToBeAdded, "newScansInLocalStorage");
Select(expScanner)

Hi @mrathi 

 

It will slow down a bit since adding functionality but sometimes it may not notice that slowness since this is a single Lookup. And it's based on the Lookup response time. Other actions are negligible amount.

 

Hi @mrathi 


Please let us know if anything needs on your post. We can help with this.

Please mark the post as Solved If I have answered your question.
Please give it a Thumbs Up if you find the suggestion helpful

Thanks,
Stalin - Learn To Illuminate

Helpful resources

Announcements
Power Apps News & Annoucements carousel

Power Apps News & Announcements

Keep up to date with current events and community announcements in the Power Apps community.

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.

Power Apps Community Blog Carousel

Power Apps Community Blog

Check out the latest Community Blog from the community!

Top Solution Authors
Top Kudoed Authors
Users online (4,554)