1

I have to filter my search result WP using a query string parameter in the KQL query:

myfield:{QueryString.XXXX}.

I need to be able to define a default filtering or default value for myfield if the query string parameter is empty.

How could achieve that?

1 Answer 1

3

You can use the ? operator. For example: {?myfield:{QueryString:XXXX}} will not effect the outcome of the query if the field has no value. You may have to play with it a bit but all the details are well documented and explained by Mikael: https://www.itunity.com/article/sharepoint-query-variables-295

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.