View Profile Link

Hi,

I am using Org Chart for O365 connecting to a SharePoint list and was wondering if it is possible to change the link that the View Profile directs to. Currently it just goes to the SharePoint list item but I would prefer it if it directed to the person’s Delve page.

Is this possible?

Thank You

Hi,

Thank you for your question.

Yes, you can modify Tooltip template as you need. Just open the configuration wizard, navigate to the ‘Tooltip template’ step and click ‘HTML mode’. You will see HTML template for tooltips. Modify link to profile according to your requirements and finish the wizard. You can use tokens to access properties from your SharePoint list.

Please read more about templates in our documentation.

Any details on the actual link used to get to the specific delve page?

Hi,

Thank you for your question. This is a template of the link:

https://YOURDOMAIN-my.sharepoint.com/Person.aspx?accountname=ACCOUNTNAME

Just replace YOURDOMAIN with your SharePoint Online domain and ACCOUNTNAME with an account name of an employee (for Office 365 it is an email address).

Hi Anton,
I'm not exactly clear how your suggestion might be implemented to be dynamic from Delve or the SP User Profile Service.

Replacing this from the list connected tooltip script:

  {{#if ListItemURL}}
    <div class="personal-page-link">
      <a href="{{ListItemURL}}"
         title="Navigate to personal page"
         target="_blank">View profile</a>
    </div>
  {{/if}}

with the default tooltip script (AD source):

  {{#if PersonalURL}}
    <div class="personal-page-link">
      <a href="{{PersonalURL}}"
         title="Navigate to personal page"
         target="_blank">View profile</a>
    </div>
  {{/if}}

just results in the link opening the entire page in a new window.

What code should be used to make the list source 'View profile' link dynamic and fetch from Delve/SP UPS?

(Then really, in the scheme of things, the source of the 'View profile' link should be a standard option in the config wizard).

Hi @agoodwin,
Can you, please clarify what's your use-case? It's yet a bit unclear from the description you've provided.
Are you aiming to redirect users to the Delve page from the tooltip of the Org Chart built on the SharePoint list as data source? Then you should use

{{#if AccountName}}
     <div class="personal-page-link">
      <a href="https://YOURDOMAIN-my.sharepoint.com/Person.aspx?accountname={{AccountName}}"
         title="Navigate to personal page"
         target="_blank">View profile</a>
     </div>
  {{/if}}

Here {{AccountName}} stands for the list column name that stores the account names of your users.
Please note that in order to do this you need to store the user account names in the SharePoint list (for example, the office365 emails in case those are the account names in your Office365 tenant).

Correct.

If i use your code suggestion like this:

  {{#if Person}}
     <div class="personal-page-link">
      <a href="https://domain-my.sharepoint.com/Person.aspx?accountname={{Person}}"
         title="Navigate to personal page"
         target="_blank">View profile</a>
     </div>
  {{/if}}

where 'Person' is a list column of type People Picker (user only, no groups). Then the resulting URL when following the link is:

https://domain-my.sharepoint.com/Person.aspx?accountname=Patrik%20Andersson

This gives an error:

Sorry, something went wrong
User not found.

Hi @agoodwin,
Yes, this is expected as your PeoplePicker field seem to show the names of your employees and you need accounts to tie those to Delve pages (please see my message above).
You can try the following:
Add a new field to store and show the user Account. If you use the People picker, you can chose the following settings:

After that, the above code will redirect you to the correct page.

There is a chance that you'll need to escape the special characters in the user's Account to get the valid URL. In this case, please use the following method:

  1. Add an empty <div> element to your Tooltip template with any custom class, like this:
    image

  2. Then add the following JS code to the Custom JavaScript tab. This code will encode the value of your Person field in a valid format and insert it in the <div> above:

renderer.onTooltipRendered(function(event, tooltip, itemData){
  var encoded = encodeURIComponent(itemData["Person"])
  var delve = tooltip.$elem.find('.delve')
  var innerHTML = '<a target="_blank" href = "https://domain-my.sharepoint.com/Person.aspx?accountname='+encoded+'"> View profile</a>'
  delve.html(innerHTML)
  });

Ah, you mean replace any existing div in the {{#if Person}} tag, otherwise this has the effect of duplicating the link.
That works. Thanks!