Hyperlink to Sharepoint

cpagano
cpagano Member
edited August 2023 in Beast Mode

Hi, I want to create a hyperlink to a sharepoint file from my domo card. The hyperlink is working correctly to the sharepoint destination. I would like the user to be able to choose a record and be taken to the matching record using the link, the only field I have to utilize is 'Name'.

I found a discussion with this example but I dont know how to make it work for me.

CONCAT('<a href="https://www.helpdesksystem.com/usersui/ticket?ID=', `ID`, '" target="_blank"></a>', ID, '')

Has anyone been successful with this type of use case?

This is what I have with the URL truncated to protect our site - url ends with redirect=true, the rest is guessing to see if I can make it work

concat('<a href= "xxxxxredirect=true/Name=',`Name`, '" target="_blank"></a>',Name, '')

Best Answer

  • marcel_luthi
    marcel_luthi Coach
    edited August 2023 Answer ✓

    Agree with @trafalger , also keep in mind that whether this will display as an hyperlink or not will depend on the kind of card you're using. One quick thing I would recommend, just to keep things following HTML standards, is that if the idea is to show the name as the text displayed for the link, to put that in between the hyperlink mark (personally I prefer not mixing single and double quotes).

    concat('<a href=''xxxxxredirect=true/Name=',`Name`, ''' target=''_blank''>',`Name`,'</a>')
    

    You should read more on the Sharepoint URL structure/anatomy to construct the right URL link, it seems you'd need a couple of other things besides the name, and if your user readable name contains spaces or special characters how are they to be handled, should you pass your text to encode or is just a replacement. Depending on the Sharepoint content it'd seem the structure for pages would be in the line of:

    https://companyname.sharepoint.com/sites/site-name/Pages/page-name.aspx
    

    Where you'd need to get the site-name and page-name from your data, so the formula would look like:

    concat('<a href=''https://companyname.sharepoint.com/sites/',`Site`, '/Pages/',`Name`,'.aspx'' target=''_blank''>',`Name`,'</a>')
    

Answers

  • trafalger
    trafalger Coach
    edited August 2023

    I've done this before but by concating fields from Domo into the URL of the system, like companyid.netsuite.com/customer/DOMOFIELD. Those specific systems had the IDs of the things in the URL so it was just a matter of recreating the URL syntax in Domo

  • marcel_luthi
    marcel_luthi Coach
    edited August 2023 Answer ✓

    Agree with @trafalger , also keep in mind that whether this will display as an hyperlink or not will depend on the kind of card you're using. One quick thing I would recommend, just to keep things following HTML standards, is that if the idea is to show the name as the text displayed for the link, to put that in between the hyperlink mark (personally I prefer not mixing single and double quotes).

    concat('<a href=''xxxxxredirect=true/Name=',`Name`, ''' target=''_blank''>',`Name`,'</a>')
    

    You should read more on the Sharepoint URL structure/anatomy to construct the right URL link, it seems you'd need a couple of other things besides the name, and if your user readable name contains spaces or special characters how are they to be handled, should you pass your text to encode or is just a replacement. Depending on the Sharepoint content it'd seem the structure for pages would be in the line of:

    https://companyname.sharepoint.com/sites/site-name/Pages/page-name.aspx
    

    Where you'd need to get the site-name and page-name from your data, so the formula would look like:

    concat('<a href=''https://companyname.sharepoint.com/sites/',`Site`, '/Pages/',`Name`,'.aspx'' target=''_blank''>',`Name`,'</a>')
    

  • cpagano
    cpagano Member
    edited August 2023

    @marcel_luthi thank you .. that is helpful, the format is more like one drive personal folders.. https://companyname.sharepoint.com/:f:/s/site-collection-name/subsite-name/Ds10TaJKAKhMp1hE0B_42WcBVhTHD3EQJKWhGprKFP3vpQ?e=14ohmf