cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
stapes
Impactful Individual
Impactful Individual

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

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.

1 ACCEPTED SOLUTION

Accepted Solutions
mdevaney
Super User
Super User

@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." 

View solution in original post

2 REPLIES 2
mdevaney
Super User
Super User

@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." 

Confirmed the solution above. Simple and elegant @mdevaney 

Helpful resources

Announcements
October Events

Mark Your Calendars

So many events that are happening this month - don't miss out!

Ignite 2022

WHAT’S NEXT AT MICROSOFT IGNITE 2022

Explore the latest innovations, learn from product experts and partners, level up your skillset, and create connections from around the world.

Power Apps Africa Challenge 2022

Power Apps Africa Challenge

Your chance to join an engaging competition of Power Platform enthusiasts.

Users online (2,515)