Try our conversational search powered by Generative AI!

How to search EpiServerProfile by property.

Vote:
 

We have a customer user management systems where administrators should be able to search for users based upon different user properties.  However we have not found a way to query the EpiServerProfile without loading each user one-by-one and looking at their properties.  Is there an API for searching the profiles?  Our profiles are being stored in the dbo.Profiles table.  Also we have custom properties attached to the profile.

I just need a way to pass in a property name and a value or set of values to an API and have it return all user profiles matching the property name and value.

Thanks in advance for your help.

#144860
Feb 19, 2016 20:39
Vote:
 

I don't think there's something nice built in for that. The properties are mainly there for the signed in user to store stuff in one to one.

You could add a job that puts the profiles into Episerver Find if you have that available. Or similiar just put all profiles in some memory collection on startup. If recall correctly the table structure for Profile metadata is not smooth for using SQL conditions so searching in database is not the best option.

Otherwise I would recommend not using Profile and instead create some ContentType for user data. Especially good to have if you plan to have a user's page showing some of the properties.

#144878
Feb 21, 2016 9:54
Vote:
 

Agree with Johan. Sooner of later you will have to display user profile pages. With epi pages, you get everything out of the box (search, editing, import/export).

If you don't want those pages to be public / browsable, you can always implement them as container pager (w/o view), and implement views when needed.

#144901
Feb 22, 2016 13:38
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.