Drill Down URL - Encoding of Values

27311

I'm attempting to "roll my own" data visualization component by pulling data using the XML link for a view.

The component will have a drill through capability, just like the native data visualizations. I am trying to recreate the drill though link, but noticing some odd behavior with the url encoding.

Let's say I click on a standard bar chart for "Miami, FL".  The drill through URL is:

metaData.siteID=1&metaData.sheetId=2&metaData.sheetViewID=3&advanceSearch=true&exactSearch=true&filterValue_111_3=Miami%5E%5E%20FL

Note that exactSearch=true is included, and the comma in "Miami, FL" is replaced with %5E%5E, which is ^^.  Why is the comma replaced?

If I run an advanced search filtering on "Miami, FL", the URL is different:

sheetHome.action?metaData.siteID=1&metaData.sheetId=2&metaData.sheetViewID=3&advanceSearch=true&filterValue_111_3=Miami%2C%20FL

There is no exactSearch parameter and the comma is retained as %2C

From testing I realized that I must include exactSearch=true.  If I don't include that parameter and I filter on a value like "New York", then the results will include similar values, like "New Hampshire".  (You can see that when running an advanced search.)

The problem becomes if I am filtering on a value like "Miami, FL" that contains a comma.  To construct my drill down url I am simply using the native encodeURIComponent() function of JS on the value.  Therefore, "Miami, FL" becomes "Miami%2C%20FL".  But if my drill down URL is constructed as:

metaData.siteID=1&metaData.sheetId=2&metaData.sheetViewID=3&advanceSearch=true&exactSearch=true&filterValue_111_3=Miami%2C%20FL

with exactSearch=true but replacing the comma with %2C, no results are returned.

I need to understand the rules for constructing the drill down URL when exactSearch is included:  how do the values in the URL parameters need to be encoded?  The only rule I have found is replacing a comma with %5E%5E.

Parents
  • Mark Salamon, the same logic seems to apply to SingleLineText fields but probably because this (exactSearch param) works agnostically. For SingleLineText fields, when searching using Advanced, looking for Miami, FL will actually look for any records with Miami or FL (punctuation is superfluous and is ignored). However, if you enclose in double quotes, then we can exact match, e.g.

    https://...?metaData.siteID=1&metaData.sheetId=2&metaData.sheetViewID=3&advanceSearch=true&filterValue_112_1="Miami%2C%20FL"

     

Reply
  • Mark Salamon, the same logic seems to apply to SingleLineText fields but probably because this (exactSearch param) works agnostically. For SingleLineText fields, when searching using Advanced, looking for Miami, FL will actually look for any records with Miami or FL (punctuation is superfluous and is ignored). However, if you enclose in double quotes, then we can exact match, e.g.

    https://...?metaData.siteID=1&metaData.sheetId=2&metaData.sheetViewID=3&advanceSearch=true&filterValue_112_1="Miami%2C%20FL"

     

Children
No Data