Search code examples
sharepointsharepoint-2013jscript

Get all the twitter account in sharepoint


In SharePoint 2013 we have a about me for all the employees that work at our company. I would like to get for example all the employees that have filled in a twitter account in their ABOUT ME page in SP2013.

So I could do something with their twitter account, all be storing it in a array.

Im using a sharepoint hosted app, so the preffered programing language is jscript. The question is how to get this data out of the about me for all employees?


Solution

  • The "About Me" page in SharePoint is really just a UI layer for data specific to the User whose page you're on; for the data you describe, it sounds like your users have the ability to add to their User Profile their Twitter handle.

    If that's the case, it's fairly straightforward to query data from the User Profile Service using the JSOM (JavaScript Object Model). This MSDN article should be more than enough to get you started: http://msdn.microsoft.com/en-us/library/office/jj920104%28v=office.15%29.aspx

    A note of guidance; if your users are instead putting their Twitter handle inside some block of multi-line text, like say a "Summary" property on their User Profile, I would strongly recommend updating your User Profiles to include a custom property for storing their Twitter handle (reference here). SharePoint makes it fairly easy to add custom User Profile properties and so having to otherwise parse something like a Twitter handle out of a block of text would be unnecessarily complicated & likely perform worse.