Hey, so it looks like this is the forum where I can post questions about the relevance language. I did a forum & google search on this site for this error, but to no avail.
If I want to include a % literal (i.e. “100%”), it throws the error specified in the subject. I cannot escape it with a backslash either.
Because it’s a web report, I’m able to get away with it by using
html “%”
, however, this morning I noticed my relevance was broken, because the percent signs html code converted into real percent signs, also, whenever I go to “edit report” directly in the web report text area, and save it, it will also convert all html code into the html tags. it’s not a problem short term, because I’m editing in an external text area, but my co-workers may choose to edit in the text area, and essentially break my web report.
So my question is, what is the best known method to have a literal percent signs in our relevance queries? preferably something other than using the
I’m not sure I following the situation exactly without full examples but I remember needing to use the ascii encoding sometimes to get things working. You get the ‘improper %-sequence’ error because the relevance language thinks you are trying to percent encode a character and you didn’t give it a property percent encoding sequence. If you percent encode the % sign, that will probably work for you.
I just looked at my original post and the forum converted the HTML code for percent sign into a percent sign. Sorry if that confused anyone!!
It appears that that works for me.
Here is a follow up question:
I thought the % sign was reserved for windows variables (i.e. “%windir%”)
But by the logic that “%25” = “%”, if I wanted to ascii encode another character, I would just “%2F” = “/”, does it work in all contexts of relevance language (i.e. in BES Console as well as BES Web Reports), because I tried in the Relevance Debugger and it spit at me
Percent encoding should work everywhere. In general it’s best to avoid environment variables if possible. They have a tendency to break and/or change based on user context and OS.
If you have to use environment strings, we have inspectors…
Q: expand environment string of “%25windir%25”
A: C:\WINDOWS
But in that particular case, I’d recommend using our ‘windows folder’ inspector instead:
You can’t test this in the debugger, as %25 (like %09) will be displayed as the character encoding, but when used in relevance in an RP or action, the end result is that it will do what you want (put double quotes around a string, add a tab between strings, etc.).