AnsweredAssumed Answered

How to embed a single quote in URI builder

Question asked by shall on Sep 4, 2018
Latest reply on Sep 5, 2018 by shall

Hi all,


I am trying to generate a URL attached to an element to a Power BI report. Power BI supports URL-embedded filtering with very specific rules. I am very close to the outcome I would like, but I need to be able to wrap the value in single quotes for Power BI. However, these get interpreted in the PI URI builder a delimiters for an attribute.


Needed: ...base URL...?filter=FilterAPI eq 'API' where 'API' is a value stored on the element.


I have tried

  • ...base URL...?filter=FilterAPI eq "'API'" (that is double quote, single quote, API, single quote, double quote) and I get the API value wrapped in double quotes ("string")
  • ...base URL...?filter=FilterAPI eq ''API'' (that is single quote, single quote, API, single quote, single quote) and I get the string API by itself
  • ...base URL...?filter=FilterAPI eq '''API''' any number more than 2 single quotes balanced on API just gets me the value for API
  • Wrapping a single quote in double quotes results in an error
  • Used single quote ASCII value (%27). The parsing does not quite work right.


Below is my closest arrival to what I want.


pi vision url.png

All I need is the single quotes wrapping the 3501724819 number (which is a string in Power BI). Worst case, I can change the data type of the FilteredAPI to be a number which would allow the URL shown to work, but I would prefer to use the data as stored, if possible.