Closed d-turley closed 6 months ago
Hi @d-turley,
Did you try the {{escape}} helper?
What is the {{escape}} helper? Is that handlebars?
We are trying to configure values for the Link URL field in the Data Verticals web part properties panel.
Because we didn't receive any news from the author of this issue, we closed it. Feel free to open it again if the issue persists.
Thank you
Version used 1.5.4
Question We have a Data Verticals web part with several verticals configured. We want to be able to carry the user's query text over when they navigate to another vertical, so in the Link URL field we entered a URL like the following:
https://contoso.sharepoint.com/sites/sandbox/SitePages/Search.aspx?q={QueryString.q}&v=Documents
This works in the general case, however if the user types in special characters, for example an ampersand (&) character, in their query then those characters are not properly escaped and the URL is corrupted when navigating.
We then found that we can use Adaptive Expressions, and altered the URL as follows to escape special characters:
https://contoso.sharepoint.com/sites/sandbox/SitePages/Search.aspx?q=${uriComponent(`{QueryString.q}`)}&v=Documents
However, this fails if the user includes the single quote (') character in their search because the {QueryString.q} token is replaced verbatim.
Is there a known way to construct this URL that handles all possible characters a user might enter into the search box? Or is there another way to configure the verticals to meet our requirements?