web
You’re offline. This is a read only version of the page.
close
Skip to main content
Community site session details

Community site session details

Session Id : UKqZMPWD0d7dewXP2iMF74
Power Apps - Building Power Apps
Answered

Barcode Scanner - If Else

Like (0) ShareShare
ReportReport
Posted on 26 Jan 2022 00:02:41 by 18

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

Categories:
  • StalinPonnusamy Profile Picture
    Super User 2024 Season 1 on 30 Jan 2022 at 04:39:56
    Re: Barcode Scanner - If Else

    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

  • StalinPonnusamy Profile Picture
    Super User 2024 Season 1 on 26 Jan 2022 at 15:13:31
    Re: Barcode Scanner - If Else

    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.

     

  • Verified answer
    mrathi Profile Picture
    18 on 26 Jan 2022 at 11:14:16
    Re: Barcode Scanner - If Else

    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)

  • StalinPonnusamy Profile Picture
    Super User 2024 Season 1 on 26 Jan 2022 at 04:50:02
    Re: Barcode Scanner - If Else

    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

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Announcing our 2025 Season 2 Super Users!

A new season of Super Users has arrived, and we are so grateful for…

Paul Stork – Community Spotlight

We are honored to recognize Paul Stork as our July 2025 Community…

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 791 Most Valuable Professional

#2
MS.Ragavendar Profile Picture

MS.Ragavendar 410 Super User 2025 Season 2

#3
mmbr1606 Profile Picture

mmbr1606 275 Super User 2025 Season 2

Loading complete