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.
This is a solution for Org Chart 3. Check the reply for Org Chart 4below.
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.
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).
This is a solution for Org Chart 3. Check the reply for Org Chart 4below.
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).
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:
Add an empty <div> element to your Tooltip template with any custom class, like this:
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)
});
The solution adds a link to the Delve page of the current employee retrieved from a SharePoint list. Person is an internal name of the Person or Group column in it. Its configuration: