2

I would like to filter CSWP results based on query string.

I have CSWP in a page ItemDetail.aspx, the query is

Path:"http://sp03:2016/Lists/Announcement%20Custom/" contentclass="STS_ListItem_Announcements", 

which is displaying all the items of the "Announcement Custom" list, like

sp03:2016/Lists/DispForm.aspx?ID=3
sp03:2016/Lists/DispForm.aspx?ID=2
sp03:2016/Lists/DispForm.aspx?ID=1

I would like to display only one item with filter by ID. I have tried to use ID={QueryString.ID} at the end but it does not work

So if my url is ItemDetail.aspx?Id=2, this should be passed to the filter and the page should display only one result: sp03:2016/Lists/DispForm.aspx?ID=2

1
Path:"sp03:2016/Lists/Announcement%20Custom/" 
contentclass="STS_ListItem_Announcements" 
ListItemID:{QueryString.ID} 

Add after your page url this #k=?ID=1

So you have this

http://YOURSITE/Pages/test.aspx#k=?ID=1

or without #k=

http://YOURSITE/Pages/test.aspx?ID=1

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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