URL Mapping

Options

Hi! I have a quick question regarding URL Mapping.

So on a table in a Domo Dataset, I wanted to make cells "clickable" so that when a user clicks on it, it leads to a hyperlink attached to it.

I was able to use this formula in doing so: (where Program guide URL and certifications are other columns of that same table)

CONCAT('<a href="',`Program Guide URL`,'"></a>',Certification,'')

However, in the case where the Program Guide URL has missing values or "Does not exist" filled up instead of an actual URL….it still leaves the text as "clickable", but does not lead to anywhere

Is there any way I can fix this? Thanks!

Best Answers

Answers

  • GrantSmith
    GrantSmith Coach
    edited November 2023
    Options

    You need your </a> at the end of certification so that it actually makes the Certification clickable to the URL you define.

    CONCAT('<a href="',`Program Guide URL`,'">',`Certification`,'</a>')
    

    **Was this post helpful? Click Agree or Like below**
    **Did this solve your problem? Accept it as a solution!**
  • StuM
    Options

    Thank you! Just realized that I mistyped it in the post, but it went properly in Domo.

    My main question was regarding values under the Program Guide URL that are either empty or not URL's. Is there a way to make those NOT clickable in those scenarios? (otherwise, if I click cells with non-existing URLs, then it just won't do anything)

    Currently it still looks like they are clickable.

  • MichelleH
    Options

    @StuM I'd suggest using a case statement to only include the HTML formatting if the Program Guide URL like below:

    case 
      when `Program Guide URL` is not null 
        then CONCAT('<a href="',`Program Guide URL`,'">',`Certification`,'</a>') 
      else `Certification`
    end  
    

  • GrantSmith
    Options
    CASE WHEN `Program Guide URL` IS NOT NULL AND `Program Guide URL` LIKE 'http%' THEN 
      CONCAT('<a href="',`Program Guide URL`,'">',`Certification`,'</a>')
    END
    

    **Was this post helpful? Click Agree or Like below**
    **Did this solve your problem? Accept it as a solution!**
  • trafalger
    Options

    I agree with Michelle and Grant - blanking it out with a case statement is absolutely the move here!

  • StuM
    Options

    Hello!

    Thanks!

    These end up with blank rows for values without invalid hyperlinks (looks like empty cells)

    Is there a way to keep the text that was originally there but removed the "clickable" part of the text (so its just the plain text, whereas those with hyperlinks would be those text with a clickable hyperlink)

  • MichelleH
    MichelleH Coach
    Answer ✓
    Options

    @StuM To keep the text, just add ELSE `Certification` to your case statement for any rows without a URL

  • GrantSmith
    GrantSmith Coach
    Answer ✓
    Options
    CASE WHEN `Program Guide URL` IS NOT NULL AND `Program Guide URL` LIKE 'http%' THEN 
      CONCAT('<a href="',`Program Guide URL`,'">',`Certification`,'</a>')
    ELSE
      `Certification`
    END
    

    **Was this post helpful? Click Agree or Like below**
    **Did this solve your problem? Accept it as a solution!**