Auto-populate current logged in user name in SharePoint 2010 People Picker control using SPServices
Check out Best Alternative to InfoPath -> Try Now
This SharePoint tutorial, we will discuss, how to Auto-populate current logged in username in SharePoint 2010 People Picker control. Here we will do by using SPServices js file provided by Codeplex. We will not use any server-side code.
Here my requirement is I have a SharePoint list that has a people picker control in it. I want to show the logged in username or email id there whenever a user tries to add an item to the list. So here we will put the code js code in the Default New Form. For this Open the List -> Customize List -> then Form Web Parts -> then click on Default New Form as shown in the fig below:
This will open the Default New Form in Edit mode. Here you click on Add a Web Part and then add a Content Editor Web Part. Once the web part added, go to format text and then Markup and then Edit Source as shown in the fig below.
You can download the SPService from the CodePlex URL and also you can download the jQuery required version from jquery website and put it in your site assets library.
In the source editor put the below code:
Auto populate urrent logged in user name in SharePoint 2010 People Picker control using SPServices
You may like following SharePoint tutorials:
- Promoted Links in SharePoint 2013/2016/Online
- http error 503. the service is unavailable in SharePoint 2013/2016
- Enable Design Manager in SharePoint Team Site
- Change Layout of a Page in SharePoint 2013
- ULS Viewer for SharePoint 2013 download
- Adding Line Bookmarks in SharePoint Designer 2013
- The local SharePoint server is not available. Check that the server is running and connected to the SharePoint farm.
- Add Print Button to Display form using jQuery in SharePoint
- SharePoint list or library group by month and year example
- Configure outgoing email settings using Gmail in SharePoint
- Configure Retention Policy in SharePoint Document Library
- Add an email address to System Account in SharePoint
Now the current user will populate in the people picker control.
This will work in SharePoint 2010. I tried in SharePoint 2013 but it did not work, If anyone has a solution for SharePoint 2013, Please let me know.
SharePoint Online FREE Training
JOIN a FREE SharePoint Video Course (3 Part Video Series)