2

I need to fetch the Sitecore user information, mainly user's first name, last name along with user name. Username can be fetched from the table Users in Core db.

Which table contains the user's first and last name details in Core db?

Thanks -Sunil

2 Answers2

1

The location of the data is outlined in the answer to this Stack Overflow question:

Sitecore Custom User Profile - where is it stored how can it be queried

As they point out, the data isn't the easily accessible and it might be a good idea to use the Sitecore API to obtain it instead.

This document talks about getting/setting standard profile properties via the API:

Security API Cookbook

... and this article talks about getting/setting custom properties:

Sitecore users custom profile properties

Community
  • 1
  • 1
Martin Davies
  • 4,436
  • 3
  • 19
  • 40
1

Sitecore doesn't provide any fields for firstname and lastname, so you can only fetch Fullname and Username. IF you want to enter these information as well then you need to create your custom fields as Martin suggested in post.

To get Fullname and Username you can use below code -

Sitecore.Context.User.Profile.FullName

Sitecore.Context.User.Profile.UserName
Yogesh Sharma
  • 2,017
  • 1
  • 15
  • 33