cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Field
Level 8

Web Users

Hi there,

 

For data porpuses, i want to know if the current user is using the Computer, or Mobile. Is there anyway we can do this?

 

Thanks.

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Field
Level 8

Re: Web Users

Figured it out a way to do this.

 

The following code:

If(Not(IsBlank(Param("tenantId"))),"PC", "Cellphone")

 

I can identify who uses PC, and cellphone.


This will get a part of the url. If url doesnt exist, it's mobile, if it does it's PC.

3 REPLIES 3
Super User
Super User

Re: Web Users

At this point the device info is not accessible in PowerApps, although it is a requested feature.  You can vote for the request here:

 

https://powerusers.microsoft.com/t5/PowerApps-Ideas/Get-Device-Info-in-PowerApps/idi-p/3173

 

Other than that your only real choice is to detect based on screen size.



-------------------------------------------------------------------------
If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.
Super User
Super User

Re: Web Users

@Field 

There is no direct property in the App to determine the device type, but the easiest way at this point is to look for a feature only available on a mobile device.  We use the Acceleration function to determine it. 

Ex:

   Set(_appIsOnDesktop, IsBlank(Acceleration.X))

If you are on a non-mobile device, the acceleration.X will return blank and thus, _appIsOnDesktop will be true.

One word of caution...put this on a time that gives the app a few moments to load.  Sometimes the Acceleration device is not yet initialized if you put it in the OnStart of the App and the mobile device will think it is on the desktop.  Give a second or two delay on the timer on the initial screen and it will have initialized by then.

 

I hope that is helpful for you.

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up. Solved your problem? - Click on Accept as Solution. Others seeking the same answers will be happy you did.
Highlighted
Field
Level 8

Re: Web Users

Figured it out a way to do this.

 

The following code:

If(Not(IsBlank(Param("tenantId"))),"PC", "Cellphone")

 

I can identify who uses PC, and cellphone.


This will get a part of the url. If url doesnt exist, it's mobile, if it does it's PC.

Helpful resources

Announcements
firstImage

Watch Sessions On Demand!

Continue your learning in our online communities.

SecondImage

PowerApps Monthly Community Call

Next Wednesday, August 21st at 8am PDT

Top Community Contributors for July 2019

Top Community Contributors for July 2019

Let's thank our top community contributors

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

FirstImage

Power Platform World Tour

Coming to a city near you

thirdimage

PowerApps Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

FourthImage

Join PowerApps User Group!!

Connect, share, and learn with your peers year-round

FifthImage

Dynamics 365 and Power Platform April 2019 Release notes

Features releasing from April 2019 through September 2019!

SixthImage

Power Summit Australia 2019

August 20-23rd 2019

Users Online
Currently online: 261 members 3,613 guests
Please welcome our newest community members: