Pfilters

Options

Hi,

I just watched Marks video about how to use pfilters so I thought id give it a shot with this beastmode.

CONCAT('<a href="https://trimble-tt-16502962.domo.com/page/2050403531?pfilters=[',
'{%22column%22:%22Lane%22,%22operand%22:%22IN%22,%22values%22:[%22',
`Lane`,
'%22]}',
']" target="_blank">',
Lane,'</a>')

The output on the card looks something like this

WAPAKONETA, OH%22]}]" target="_blank">ALBANY, NY> WAPAKONETA, OH.

I thought Id go to the documentation that mark linked in his video https://domo-support.domo.com/s/article/360042933114?language=en_US to try and find the answer but that page says the following.

Any idea how to fix either of these problems?

Best Answer

  • marcel_luthi
    marcel_luthi Coach
    edited January 11 Answer ✓
    Options

    This is just a guess, but it could be possible that some of your Lane values contains characters that are causing this to break, for which you should URL Encode it, just to be sure nothing is breaking it. Sadly, MySQL does not offer a URLENCODE function AFAIK, so you'll need to do with a bunch of replacements, these are some of the most common ones:

    %20 - space
    %27 - single quote
    %7C - |
    %26 - &
    %5E - ^
    %2B - +
    %2D - -
    %25 - %
    %22 - "

    having this in your text might cause it to break, so I'd suggest replacing them, first you should replace the % sign and then all of the others, so you'll use something like:

    REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(`Lane`,'%','%25'),' ','%20'),'''','%27'),'|','%7C'),'&','%26'),'^','%5E'),'+','%2B'),'-','%2D'),'"','%22')
    

    There are many more characters that might need to be escaped, but these are the most common ones, so if it stills breaks, try looking at the lanes that are causing this to break and then identify what character is the one where it is breaking.

Answers

  • GrantSmith
    Options

    Looks like you're using %22 which is a " character which would end your HREF property on your A tag. Try using single quotes instead (%27)

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

    Domo changed their KB site, so that link no longer works as you found out. Here is an updated link where you can find the Domo Documentation.

    https://domo-support.domo.com/s/article/360043430113?language=en_US

    Scroll down to Create Page Analyzer Links.

    **Check out my Domo Tips & Tricks Videos

    **Make sure to <3 any users posts that helped you.
    **Please mark as accepted the ones who solved your issue.
  • ColinHaze
    Options

    GrantSmith I tried replacing all the %22 to %27 and that had the same result. Its weird because if I take out the first `Lane` the link displays the correct information but on the page it takes me to, it does not filter it by lane.

  • marcel_luthi
    marcel_luthi Coach
    edited January 11 Answer ✓
    Options

    This is just a guess, but it could be possible that some of your Lane values contains characters that are causing this to break, for which you should URL Encode it, just to be sure nothing is breaking it. Sadly, MySQL does not offer a URLENCODE function AFAIK, so you'll need to do with a bunch of replacements, these are some of the most common ones:

    %20 - space
    %27 - single quote
    %7C - |
    %26 - &
    %5E - ^
    %2B - +
    %2D - -
    %25 - %
    %22 - "

    having this in your text might cause it to break, so I'd suggest replacing them, first you should replace the % sign and then all of the others, so you'll use something like:

    REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(`Lane`,'%','%25'),' ','%20'),'''','%27'),'|','%7C'),'&','%26'),'^','%5E'),'+','%2B'),'-','%2D'),'"','%22')
    

    There are many more characters that might need to be escaped, but these are the most common ones, so if it stills breaks, try looking at the lanes that are causing this to break and then identify what character is the one where it is breaking.

  • ColinHaze
    Options

    marcel_luthi That seemed be the issue. I had a > sign in the Lane. My workaround was to replace > with "to". Thanks for the help!