+ Start a Discussion
SrishSrish 

Fetch users/profiles via SOQL for whom lightning experience has been enabled

Can we fetch all those users who have access to lightning experience? Or if we can get all those profiles for which Lightning Experience User permission has been enabled.
Best Answer chosen by Srish
Ashif KhanAshif Khan
Hi Srish 
 
//for User 

Select Id ,Name ,UserPreferencesLightningExperiencePreferred from user 

//for profile 

SELECT Id,Name, PermissionsLightningExperienceUser FROM Profile



Regards
Ashif

All Answers

Raj VakatiRaj Vakati
Select Id ,Name ,UserPreferencesLightningExperiencePreferred from user 
Ashif KhanAshif Khan
Hi Srish 
 
//for User 

Select Id ,Name ,UserPreferencesLightningExperiencePreferred from user 

//for profile 

SELECT Id,Name, PermissionsLightningExperienceUser FROM Profile



Regards
Ashif
This was selected as the best answer
VinodBatraVinodBatra
Hi Srish,

If you want to use SOQL: -
 
//User    
SELECT Name, UserPreferencesLightningExperiencePreferred FROM User

//Profile
SELECT Name, PermissionsLightningExperienceUser FROM Profile

You can also view and switch users to lightning using :-

Lightning Experience Migration Assistant - > Set Up Users -> Switch Users to Lightning Experience

Thanks,
Vinod Batra
SrishSrish
Thank you so much Raj V, Ashif Khan and Vinod Batra for the help! Your replies solved my issue :)
Gabriel Meneses 10Gabriel Meneses 10
Good day to all,

I want to share a workbench query that might be a bit more useful to determining which users have the Lightning Experience User enabled. The lightning preferred is more for users with preferred login method to be Lightning vs Classic. 


This query will pull Lightning Experience Users instead, hope this helps someone.

SELECT 
AssigneeId, 
Assignee.Name, 
Assignee.Profile.Name, 
PermissionSet.isOwnedByProfile, 
PermissionSet.IsCustom, 
PermissionSet.Label
FROM PermissionSetAssignment
WHERE PermissionSetId IN
(
SELECT
Id FROM PermissionSet
WHERE PermissionsLightningExperienceUser = TRUE
)
AND Assignee.isActive = TRUE
ORDER BY Assignee.Profile.Name, Assignee.Name