Skip to main content

How to add hyperlink to a field ( Ex : Policy Number) in a dashboard.

Comments

11 comments

  • Tal Admon

    Hi Satish,

    Here's a script example for a pivot table.

    It assumes that the policy ID is on the left-most column, and that you can concat this id to the admin_url and get the policy URL directly. 

    widget.on('ready',function(se,ev) {
    var admin_url = 'https://my.admin.com/policy/' ;
    $(element).find('tbody').find('td[fidx="0"]').find('span').each(function(){
    var x = $(this).html();
    $(this).html('<a href="'+admin_url+x+'" target="_blank">'+x+'</a>')
    });
    })

    It will replace the value of this column to a link for the policy. target="_blank" will make sure that the link will be opened in the new tab.

    Regards,
    Tal

    0
  • Satish Vantaku

    Hi Tal,

    Thanks a lot for the help, now we are able to enable hyperlinks on the ID column.

    We have an admin URL of below format :

    var admin_url = 'http://sfoepr01./ipb-app/faces/work/task-details.xhtml?id=27722&_windowId=W1526366389940#noback';

    When the user click on different policy id, that should get inserted into above URL ( EX : id 27722 should change when a user clicks on different id, can we do that.

    Regards,

    Satish

    0
  • Tal Admon

    So the _windowId is fixed? if so, you can do:

    var admin_url = 'http://sfoepr01./ipb-app/faces/work/task-details.xhtml?id=';

    var post_url = '&_windowId=W1526366389940#noback';

     $(element).find('tbody').find('td[fidx="0"]').find('span').each(function(){
    var x = $(this).html();
    $(this).html('<a href="'+admin_url+x+post_url'" target="_blank">'+x+'</a>')
    });
    0
  • Satish Vantaku

    Hi Tal,

    Thanks for the script, its working. But only problem here is when we edit the widget, then we are able to click on the policy number and navigate to the hyperlinked URL.

    When we open the report normally without editing it, then hyperlink does not work. can you help me in solving this.

     

    Regards,

    Satish

    0
  • Satish Vantaku

    Hi Tal,

    Do we need to add the script on the main widget as well.

    At present we have edited the report and then went to edit script and uploaded the script which you have provided. Do we  need to open the dashboard as it is and update the script there as well.

    Ex: once we click on options ( which is beside the switch to view mode and we have edit script, do we need to insert any script over there?

    Right now we have inserted script in the edit widget --> options --> edit script

    Regards,

    Satish

    0
  • Tal Admon

    This should be a widget script, so what you did sounds like the right thing to do.

    Make sure you have the entire script there, not just what I wrote on my 2nd comment: 

    widget.on('ready',function(se,ev) {
    var admin_url = 'http://sfoepr01./ipb-app/faces/work/task-details.xhtml?id=';
    var post_url = '&_windowId=W1526366389940#noback';

    $(element).find('tbody').find('td[fidx="0"]').find('span').each(function(){
    var x = $(this).html();
    $(this).html('<a href="'+admin_url+x+post_url'" target="_blank">'+x+'</a>');
    });
    })

    Save the widget script (from widget --> options --> edit script), go back to the edit widget page, refresh the page and click apply to return to the dashboard.

    You should see the script gets applied when on the widget in the dashboard.

    If not, I suggest contact Sisense Support...

    Hope that helps,
    Tal

    0
  • Satish Vantaku

    Hi Tal,

    Thanks for the update. 

    we have a dashboard with summary and details reports. When i try to edit the summary report and  insert hyperlink script, it works. when i edit the detailed report and insert the hyperlink link script it doesn't work. Not sure why its happening.

    One more observation from my side, i have added 2 screenshots, when we have (save a copy/edit script/analyze Jsql) the hyperlink script does not work. When we have all the other options ( save a copy/edit script/selection /widget effects/drills/analyze) then hyperlink script is working.

    Regards,

    Satish

    0
  • Satish Vantaku

    Hi Tal,

    Can we add different hyperlinks to a single report.

    Ex: we have two database (Oracle & MSSQL) when we point the report to oracle the hyperlink should open Oracle UI and when we point the report to MSSQL the MSSQL hyperlink should come up.

    Can we do this.

     

    Regards,

    Satish

    0
  • Vikas Sharma

    but in our case links are working for the first page of the table and when clicking on another page disappearing , Please suggest what can be the reason

    0
  • Jessica Orlando

    This is great! Is there a way to display the 'Company Name' instead of the ID for the URL field (but the ID is still what is used to navigate to the hyperlink site)?

    0
  • Gabi Susser

    Hi Tal,

    How do i add a dynamic parameter to the URL query string based on row value? 

    I have this pivot table generate using live view 

    I would like for each student ID to generate a URL in this format: https://www.ourcrm.com/?studentID=[studentId]&orderID=[OrderID] 

    Where [studentID] and  [OrderID] are the values in each row 

    In this example the URL for the first row will be 

    https://www.ourcrm.com/?studentID=6454644&orderID=5556865 

    I succeeded to create a link from the studentID row using the script you posted:


    widget.on('ready',function(se,ev) {
    var admin_url = 'https://admin.eteacherapps.com/adminabroad/students/card/summary.asp?studentId=' ;
    $(element).find('tbody').find('td[fidx="1"]').find('span').each(function(){
    var x = $(this).html();
    $(this).html('<a href="'+admin_url+x+'" target="_blank">'+x+'</a>')
    });
    })

    When clicking on studentID in the first row in the screenshot it takes me to the correct URL which is:

    http://admin.eteacherapps.com/eTeachera222707-C695941B03B7DC3A4F35FE18844D9417/adminabroad/students/card/summary.asp?studentId=8056316

    My question is what script do i need in order to get to the correct orderid url which is:

    http://admin.eteacherapps.com/eTeachera222707-C695941B03B7DC3A4F35FE18844D9417/adminAbroad/students/card/order.asp?StudentID=8056316&OrderID=5556865

     

     

     

     

    0

Please sign in to leave a comment.