SOLVED

PnP Modern Search - Use Users Department in Query

Bronze Contributor

The idea is to create a view of a list via search which will only shows results where Department column in list = current user's Department.

 

Is something this possible??

 

Was thinking something like classic Change query worked...

 

{searchbox} Department={User.Department}

1 Reply
best response confirmed by Warwick Ward (Bronze Contributor)
Solution
Looks like the above tokens do work in PnP Modern Search - I just need modify it a bit, using the debug view allowed me to nail it down

https://microsoft-search.github.io/pnp-modern-search/usage/search-results/tokens/

{searchbox} Department="{User.Department}"

the above works now with the " " in place
1 best response

Accepted Solutions
best response confirmed by Warwick Ward (Bronze Contributor)
Solution
Looks like the above tokens do work in PnP Modern Search - I just need modify it a bit, using the debug view allowed me to nail it down

https://microsoft-search.github.io/pnp-modern-search/usage/search-results/tokens/

{searchbox} Department="{User.Department}"

the above works now with the " " in place

View solution in original post