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

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Is there a method of t...
Power Apps
Answered

Is there a method of telling whether a device has barcode scanner or not?

(0) ShareShare
ReportReport
Posted on by 894

Is it possible to tell from within the App, when it is running, whether the device you are running on can do barcode scan or not?

This would allow me to put in some extra logic so I do not have to add extra bits just for testing / building on a PC.

For instance, I could do manual entry of the codes where a scanner does not exist.

Categories:
I have the same question (0)
  • Verified answer
    mdevaney Profile Picture
    29,991 Moderator on at

    @stapes 

    While you can't directly ask PowerApps if the device is PC or mobile you can assume if the Acceleration variable is blank you are on a PC.  This is because a PC has no Accelerometer 🙂

     

    I suggest using this code in the OnStart property of your app.

    Set(deviceType, If(IsBlank(Acceleration.X), "PC", "Mobile"))

     

    ---
    Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up." 

  • GarethPrisk Profile Picture
    2,828 on at

    Confirmed the solution above. Simple and elegant @mdevaney 

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 358 Most Valuable Professional

#2
11manish Profile Picture

11manish 214 Super User 2026 Season 2

#3
Mohsin Ali Profile Picture

Mohsin Ali 185

Last 30 days Overall leaderboard