Friday, September 4, 2015

Creating another Delve Clone–A real one this time!

Ok…..once again it’s Friday and that means my mind starts to spin. This time around a question about using Delve for external users from the Delve group of the Office 365 Yammer network.

image

The Delve application itself is not available for external users, but the signals from external users are. I have previously created a Delve clone using the Content Search Web Part, which also works for external users. It should be polished a bit though :)
This time I decided to go the easier route to avoid doing any polishing.
  1. Navigate to Delve from a random tenant you have access to https://delve.sharepoint.com/_layouts/15/me.aspx
  2. Do view source in the browser and save the markup as delve-rip.aspx
  3. Navigate to the site pages library in a team site
  4. Upload the file saved in step 2
    image
  5. Share the site with an external user
  6. Navigate to the shared site and page
My external user did not have any home page activity, but below are screenshots of the Activity and Profile pages for my external user on the tenant.

image

image

The reason why this works is that Delve is made up entirely of JavaScript. It didn’t work right away as those scripts have some hardcoded absolute paths to /_vti_bin/DelveApi.ashx which can fail for external users if you haven’t shared the root site collection. So I used a small Fiddler script in a proxy to re-write the wrong URL’s for the sake of the POC to make them relative to the shared site.

Which means if you just copy and upload it will work for internal users, but perhaps not for external ones unless they are at the root site collection of the tenant. It could also be possible to debug the javascript files and override them to use correct url's - or just program your own Delve application using the API's. At least it's possible!

Want to know more… give me a shoutout!

10 comments:

  1. Hi Mikael, could you share the Fiddler script you used?

    ReplyDelete
    Replies
    1. I added this part to the OnBeforeRequest function to re-write some paths:

      if (oSession.PathAndQuery.Contains("/_vti_bin/DelveApi.ashx")) {
      oSession.hostname="microsoft.sharepoint.com";
      var oldPath = oSession.PathAndQuery;
      oldPath = oldPath.Replace("/_vti_bin/DelveApi.ashx","");
      oSession.PathAndQuery="/teams/GraphInsights/_vti_bin/DelveApi.ashx" + oldPath;
      }
      if (oSession.PathAndQuery.Contains("/log/basicevents")) {
      oSession.hostname="microsoft.sharepoint.com";
      oSession.PathAndQuery="/teams/GraphInsights/_vti_bin/DelveApi.ashx/log/basicevents";
      }

      Delete
  2. Hi Mikael, how to create Organization chart as shown in the delve?

    ReplyDelete
    Replies
    1. You either use the old webpart or create your own based on manager field in UPA. Happy coding :)

      Delete
    2. Hi, is there any property to get user office location? i have tried with SPS-Location, OfficeLocation but no luck.

      Delete
    3. {User.SPS-Location.Name} will return the term label for Office Location.

      Delete
  3. I tried to create Org chart using Graph API but for one user it's showing wrong direct reports, what could be the reason?

    ReplyDelete
    Replies
    1. Wait for reindexing of user profiles, or edit it to make sure it's reindexed perhaps?

      Delete
  4. Hi Mikael, have you also tried to create an SPFx webpart showing delve information?

    ReplyDelete
    Replies
    1. Only using the search REST api, which works just fine.

      Delete