Skip to content
Rishan Solutions
Rishan Solutions
  • PowerApps
  • SharePoint online
  • PowerAutomate
  • Python
  • AI
Rishan Solutions
Latest Posts
  • Taj Mahal, India February 22, 2026
  • How Generative AI Is Transforming Business Automation in 2026: From Task Bots to Autonomous Workflows February 11, 2026
  • Agentic AI: The Dawn of Autonomous Intelligence Revolutionizing 2025 June 24, 2025
  • Recursive Queries in T-SQL May 7, 2025
  • Generating Test Data with CROSS JOIN May 7, 2025
  • Working with Hierarchical Data May 7, 2025

Using tag/category filters

Posted on April 23, 2025April 23, 2025 by Rishan Solutions

Adding tag or category-based filters to your Power Pages listings (such as articles, events, products, etc.) enables users to refine results easily. This feature boosts usability and navigation, especially in content-rich portals.


Step-by-Step Guide to Implementing Tag/Category Filters


Scenario Example

You have a list of Knowledge Articles, and each article has a related Category (a lookup to another table or a choice field). Users should be able to filter articles based on category tags.


Step 1: Set Up the Data Model in Dataverse

Option A: Lookup Field (Recommended for relational filtering)

  • Table: Knowledge Article
  • Field: Category (lookup to Article Category table)

Option B: Choice Field

  • Field: Tags (choice set like Technical, Policy, Billing)

Make sure these fields are enabled in table permissions for read access.


Step 2: Add Tag/Category Filter UI

<select id="categoryFilter">
<option value="">-- Filter by Category --</option>
<option value="technical">Technical</option>
<option value="policy">Policy</option>
<option value="billing">Billing</option>
</select>

Optionally, you can make this dynamic by fetching categories from Dataverse using a Web Template or Liquid.


Step 3: Pass Filter as a Query Parameter

Add JavaScript to reload the page with the selected filter:

<script>
document.getElementById('categoryFilter').addEventListener('change', function () {
const selected = this.value;
const url = new URL(window.location.href);
if (selected) {
url.searchParams.set('category', selected);
} else {
url.searchParams.delete('category');
}
window.location.href = url.toString();
});
</script>

Step 4: Use Liquid to Apply Filtering

Capture the query parameter:

{% assign selectedCategory = request.params['category'] | escape %}

Now filter your FetchXML based on the selected category:

{% fetchxml articleResults %}
<fetch>
<entity name="knowledgearticle">
<attribute name="title" />
<attribute name="article_category" />
{% if selectedCategory != empty %}
<filter>
<condition attribute="article_category" operator="eq" value="{{ selectedCategory }}" />
</filter>
{% endif %}
</entity>
</fetch>
{% endfetchxml %}

If you’re using a choice field instead of a lookup, adjust the attribute and value accordingly.


Step 5: Display the Filtered Results

<ul>
{% for item in articleResults.results.entities %}
<li>{{ item.title }}</li>
{% else %}
<li>No articles found under this category.</li>
{% endfor %}
</ul>

Optional Enhancements

  • Multiple Tag Filters: Use checkboxes instead of a dropdown and filter on multiple values.
  • AJAX Filtering: Use JavaScript to fetch and render results without page reload.
  • Clear Filter Button: Add a button to reset and reload the unfiltered list.

Use Cases

  • Knowledgebase filtered by category (e.g., Technical, Legal, Billing)
  • Product catalog by brand or type
  • Events filtered by date, type, or location
  • Blog posts by tags or authors

Best Practices

  • Keep the tag list short and meaningful
  • For hierarchical categories, consider cascading filters
  • Combine with keyword search for powerful filtering
Posted Under Power Pagescategory filter category-based search content navigation custom UI filters Dataverse Lookup dynamic filtering fetchxml filter filter by tag low-code filtering metadata filtering multiple filters portal best practices portal UX Power Pages Power Pages Search searchable listings tag filters

Post navigation

Highlighting search terms in results
Real-time filter experience using JavaScript

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Recent Posts

  • Taj Mahal, India
  • How Generative AI Is Transforming Business Automation in 2026: From Task Bots to Autonomous Workflows
  • Agentic AI: The Dawn of Autonomous Intelligence Revolutionizing 2025
  • Recursive Queries in T-SQL
  • Generating Test Data with CROSS JOIN

Recent Comments

  1. Michael Francis on Search , Filter and Lookup in power apps
  2. A WordPress Commenter on Hello world!

Archives

  • February 2026
  • June 2025
  • May 2025
  • April 2025
  • March 2025
  • February 2025
  • March 2024
  • November 2023
  • October 2023
  • September 2023
  • August 2023
  • June 2023
  • May 2023
  • April 2023
  • February 2023
  • January 2023
  • December 2022
  • November 2022
  • October 2022
  • January 2022

Categories

  • Active Directory
  • AI
  • AngularJS
  • Blockchain
  • Button
  • Buttons
  • Choice Column
  • Cloud
  • Cloud Computing
  • Data Science
  • Distribution List
  • DotNet
  • Dynamics365
  • Excel Desktop
  • Extended Reality (XR) – AR, VR, MR
  • Gallery
  • Icons
  • IoT
  • Java
  • Java Script
  • jQuery
  • Microsoft Teams
  • ML
  • MS Excel
  • MS Office 365
  • MS Word
  • Office 365
  • Outlook
  • PDF File
  • PNP PowerShell
  • Power BI
  • Power Pages
  • Power Platform
  • Power Virtual Agent
  • PowerApps
  • PowerAutomate
  • PowerPoint Desktop
  • PVA
  • Python
  • Quantum Computing
  • Radio button
  • ReactJS
  • Security Groups
  • SharePoint Document library
  • SharePoint online
  • SharePoint onpremise
  • SQL
  • SQL Server
  • Template
  • Uncategorized
  • Variable
  • Visio
  • Visual Studio code
  • Windows
© Rishan Solutions 2026 | Designed by PixaHive.com.
  • Rishan Solutions