Forum Discussion
Sam1209
Mar 30, 2023Brass Contributor
SharePoint Content Query Web Part help
I am building a SharePoint classic web part page with several Content Query Web Parts on and am also using a query string in the URL. The CQWP have a filter to only show results if URL Query String i...
ganeshsanap
Mar 30, 2023MVP
Sam1209 If you have created a list with columns like: Category and Description, you can use SharePoint REST API in script editor/content editor web part to get the description corresponding to category you get from URL.
Check this to get category from URL using Javascript: How can I get query string values in JavaScript?
Then use REST API query like:
https://contoso.sharepoint.com/sites/SiteName/_api/web/lists/getbytitle('List Name')/items?$select=Category,Description&$filter=Category eq '<category-value-from-URL>'
Then you can bind the returned results to SharePoint UI using HTML/JavaScript.
Please click Mark as Best Response & Like if my post helped you to solve your issue. This will help others to find the correct solution easily. It also closes the item. If the post was useful in other ways, please consider giving it Like.
For SharePoint/Power Platform blogs, visit: Ganesh Sanap Blogs