Question

how to escape a special character in my dynamic URL


Userlevel 1

Hello , I’m having an issue in which I have a parameter in my URL , for the most part it works well except one the user selects the values that have an underscore in the value of the selection.

So, the parameter allows my user to have a dynamic dimension on the dashboard , that all works fine, then I have another dashboard to which I'd like to navigate to from dashboard number one. The second goal of that navigation is to also take with you all the applied filters and selections done in the parameters. To achieve that I’m using the link property on the dynamic dimension.

Parameter: 

parameter: MyParam {
    type: unquoted
    default_value: "Value1"
    allowed_value: { label: "Something" value: "Value1"}
    allowed_value: { label: "Something" value: "Value2"}
    allowed_value: { label: "Something" value: "Value_3"}
    allowed_value: { label: "Something" value: "Value4"}
    allowed_value: { label: "Something" value: "Value_5"}
    allowed_value: { label: "Something" value: "Value_6"}
}

Then I have a link:

&ParameterNameOnDashboard={% parameter MyParam %}

So, when the user selects value1 , 2 or 4 , it all works fine , the navigation occurs and it takes away the value selected. The problem arises when the user selects option 3,5 or 6. Then it doesn't work because of the “_” and the URL encoding I believe, that encoding is not being done so while the browser is expecting something like “Value%5E_5” he’s actually receiving “Value_5” and then it brakes.

I tried: 

&ParameterNameOnDashboard={% parameter MyParam | escape %}
&ParameterNameOnDashboard={% parameter MyParam | URL_ENCODE %}
&ParameterNameOnDashboard={% parameter MyParam | URL_DECODE %}

but none of those worked. Any ideas on how i can solve this one !?


This topic has been closed for comments