Tech
News
Videos
Forums
Jobs
Books
Events
More
Interviews
Live
Learn
Training
Career
Members
Blogs
Challenges
Certification
Contribute
Article
Blog
Video
Ebook
Interview Question
Collapse
Feed
Dashboard
Wallet
Learn
Achievements
Network
Rewards
SharpGPT
Premium
Contribute
Article
Blog
Video
Ebook
Interview Question
Register
Login
Auto Populate Current User Login Name in SharePoint
WhatsApp
Laxman Vyavahare
9y
28.1
k
0
0
25
Blog
<script src=
"https://code.jquery.com/jquery-1.10.2.min.js"
type=
"text/javascript"
></script>
<script src=
"https://cdnjs.cloudflare.com/ajax/libs/jquery.SPServices/2014.02/jquery.SPServices-2014.02.min.js"
type=
"text/javascript"
></script>
<script type=
"text/javascript"
>
$(document).ready(
function
() {
// get the title of current user
var
UserName= $().SPServices.SPGetCurrentUser({
fieldName:
"Title"
,
debug:
false
});
//populate the field ‘Requestor’ with the current account
$(
'textarea[title="Requestor"]'
).val(UserName);
$(
'input[title="Requestor"]'
).val(UserName);
});
</script>
In following Image you can see current user name will be auto populated on page load.
Auto populate current user
Up Next
Programmatically Check whether Current Logged in User is a Member of SharePoint User Group or Not
Ebook Download
View all
Getting Started with SharePoint Framework Development using TypeScript, PnP JS, and React JS
Read by 4.9k people
Download Now!
Learn
View all
Membership not found