While migrating solutions and scripts from SP2010 to SP2013 “_spUserId” doesn’t work

  •  
  •  
  •  
  •  
  •  
  •  

When migrating solutions from and script from SharePoint 2010 to 2013, we ran into some weird error where we could not fetch the current logged in user with “_spUserId” anymore.

var user = _spUserId

As a workaround we used below;

var user = currentWeb.get_currentUser();

About Rupesh Singh

Development experience with Microsoft SharePoint and its related technologies SharePoint 2010, SharePoint 2013, SharePoint 2016, Office 365, Javascript, JQuery, AngularJS, React JS, Node JS, SharePoint Framework, ASP.net, SQL Server 2008/2012, HTML5, CSS3, InfoPath, SharePoint Workflow, Power Apps, Power BI, SharePoint Customization, Power User.

View all posts by Rupesh Singh →

Leave a Reply

Your email address will not be published.

2 × 5 =