(O365) Content Query and Current User AD fields
Is there an easy approach to setup query filters for CQWP to use the current users Department, Location etc fields from their profile. I know you can get values from the Page Field Filter in the CQWP: [PageFieldValue: fieldName] , but doesnt look like you can use [CurrentUserValue: field] from the Current User Filter :p The idea is to filter some Content Types that has a corresponding column for Department. So users only get the items taged with their Department. And one of the criteria is that the solution needs to be close to out of the box.
May 21st, 2012 2:44am

Hi Content, The query result of the content query web part is from list or library. So, you want to get the current use profile form CQWP is not possible as far as I know. You can only put your all user profile into a list, then filter the user., you will get the result. Another way is do it by SharePoint object module. You can get all data by C#, then bind the dada with Gridview or SPgridview. private UserProfile getCurrentUserProfile() { SPUser user = SPContext.Current.Web.CurrentUser; //Create a new UserProfileManager UserProfileManager pManager = new UserProfileManager(); //Get the User Profile for the current user return pManager.GetUserProfile(user.LoginName); } You can refer to the following link about SPGridview. http://nishantrana.wordpress.com/2009/03/23/using-spgridview-to-bound-to-list-data-in-sharepoint/ Thanks, Jack
Free Windows Admin Tool Kit Click here and download it now
May 27th, 2012 3:11am

Hi Content, The query result of the content query web part is from list or library. So, you want to get the current use profile form CQWP is not possible as far as I know. You can only put your all user profile into a list, then filter the user., you will get the result. Another way is do it by SharePoint object module. You can get all data by C#, then bind the dada with Gridview or SPgridview. private UserProfile getCurrentUserProfile() { SPUser user = SPContext.Current.Web.CurrentUser; //Create a new UserProfileManager UserProfileManager pManager = new UserProfileManager(); //Get the User Profile for the current user return pManager.GetUserProfile(user.LoginName); } You can refer to the following link about SPGridview. http://nishantrana.wordpress.com/2009/03/23/using-spgridview-to-bound-to-list-data-in-sharepoint/ Thanks, Jack
May 27th, 2012 3:11am

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics