“If you want to master Power Pages, start with the foundation – and in portals, that foundation is Liquid.”
Hello, fellow developers!
In this blog, I’m going to walk you through the most commonly used Liquid objects in Power Pages (formerly Power Apps Portals). If you’re working on customizing portals, Liquid is your best friend. It's the templating language that makes dynamic content rendering easy and efficient.
Whether you're building a knowledge base, a customer portal, or a partner onboarding site, knowing how to use Liquid objects can help you build smarter pages, reduce code duplication, and improve performance.
Let’s dive in!
What is Liquid in Power Pages?
Liquid is an open-source template language originally created by Shopify. Microsoft has integrated it into Power Pages to let developers render dynamic content directly on portal web pages, forms, and templates.
In simple terms, Liquid helps you to retrieve and manipulate data from Dataverse and display it on the portal without writing any JavaScript or server-side code.
Most Frequently Used Liquid Objects
Let’s look at the most used Liquid objects in Power Pages, along with simple examples. I’ll also explain where to use them in real-world scenarios.
1. User Object
- Purpose: Gives details about the currently logged-in user.
- Use Case: Personalizing greetings or filtering data based on user roles.
{% if user %}
<p>Welcome, {{ user.fullname }}!</p>
{% else %}
<p>Welcome, guest!</p>
{% endif %}
Explanation
- If a user is logged in, show their full name.
- Otherwise, show a generic message.
![Message]()
The output.
![Output]()
2. Website Object
- Purpose: Returns information about the current portal website context.
- Use Case: Useful when you’re managing multi-portal environments or want to display site-specific settings.
{{ website.adx_name }} ({{ website.id }}
Explanation: Displays the current portal website’s name. Not used frequently, but handy in multi-site scenarios.
![Multi-site scenarios]()
3. Request Object
- Purpose: Access query string parameters, form inputs, headers, etc.
- Use Case: Reading data from URLs or query strings.
{% assign city = request.params['city'] %}
<p>You are viewing results for: {{ city }}</p>
Explanation: This will show the value of the city from the URL query string, like ?city=Chennai.
4. Entities Object
- Purpose: Fetch records from Dataverse using the entity logical name.
- Use Case: Displaying dynamic content like announcements, blogs, or cases.
{% assign articles = entities.news | where: "statecode", 0 | sort: "createdon" | slice: 0, 3 %}
<ul>
{% for article in articles %}
<li>
<a href="/news/{{ article.id }}">{{ article.title }}</a>
</li>
{% endfor %}
</ul>
Explanation
- Pulls the top 3 active news items from the news table.
- Useful for dashboards, home pages, or custom lists.
5. Page Object
- Purpose: Provides metadata about the current portal web page.
- Use Case: Displaying dynamic titles, breadcrumbs, or page-level conditions.
<h1>{{ page.title }}</h1>
Explanation: Prints the current portal page title. Very useful for consistent headers and breadcrumb components.
6. Portal Object
- Purpose: Gives access to portal-level settings like language, web roles, or content snippets.
- Use Case: Multi-language support and role-based display.
<p>Current Language: {{ portal.language.code }}</p>
Explanation: Displays the current language being used on the portal. Useful for multilingual portals.
7. Snippet Object
- Purpose: Displays reusable pieces of content defined in the portal.
- Use Case: Footer text, disclaimers, contact info, etc.
<p>{{ snippets.footer_note }}</p>
Explanation: You can define a footer note in Portal Management and reuse it across pages.
8. Content Object
Used to access the current web file or web page content.
<h1>{{ content.name }}</h1>
<p>{{ content.notes }}</p>
9. Webpage Object
Similar to the page, but gives more detailed info, including parent pages.
<p>Page Title: {{ webpage.title }}</p>
<p>Parent Page: {{ webpage.parentpage.title }}</p>
10. Webrole Object
To check if the user belongs to a specific web role.
{% assign roles = user.webroles %}
{% for role in roles %}
<p>Your role: {{ role.name }}</p>
{% endfor %}
11. Lookup Object
Used to access lookup fields on a record.
<p>Owner: {{ entities.contact[0].ownerid.name }}</p>
12. Add Object (Advanced Data)
Used to query Dataverse with FetchXML or EntityList configuration.
{% fetchxml mycontacts %}
<fetch>
<entity name="contact">
<attribute name="fullname" />
<filter>
<condition attribute="statecode" operator="eq" value="0" />
</filter>
</entity>
</fetch>
{% endfetchxml %}
<ul>
{% for contact in mycontacts.results.entities %}
<li>{{ contact.fullname }}</li>
{% endfor %}
</ul>
13. URL Object
Gives current URL info – good for conditional logic or tracking.
<p>You are on page: {{ url.full }}</p>
14. Params Object (Alternative to request.params)
For retrieving query string values.
{% assign campaign = params['src'] %}
<p>Campaign Source: {{ campaign }}</p>
15. Form Object
Used in web forms to retrieve submitted values.
<p>Submitted Name: {{ form.firstname }}</p>
Note. Works only in the context of form submission steps (like multistep forms).
16. Articles Object (Entity List output)
Used when rendering Entity List outputs configured in Portal Management.
{% for article in articles.entities %}
<h3>{{ article.title }}</h3>
<p>{{ article.description }}</p>
{% endfor %}
17. Language Object
Access current UI language metadata.
<p>Current Language Code: {{ language.code }}</p>
<p>Current Language Name: {{ language.name }}</p>
18. Blogs Object (Custom table usage example)
Assuming blogs is a custom Dataverse table.
{% assign posts = entities.blogs | where: "status", "Published" | sort: "createdon" | reverse %}
<ul>
{% for post in posts %}
<li><a href="/blog/{{ post.id }}">{{ post.title }}</a> ({{ post.createdon | date: "%d-%m-%Y" }})</li>
{% endfor %}
</ul>
19. Forloop Object (Inside loops)
Useful for adding numbering, first/last checks, etc.
<ol>
{% for item in posts %}
<li>
{{ forloop.index }}. {{ item.title }}
{% if forloop.last %}
<strong>(Last post)</strong>
{% endif %}
</li>
{% endfor %}
</ol>
20. Settings Object
To access site settings defined in Portal Management.
<p>Support Email: {{ settings["Support/Email"] }}</p>
21. Sitemarkers Object
To retrieve URLs based on Site Markers instead of hardcoding.
<a href="{{ sitemarkers["Contact Us"].url }}">Contact Us</a>
22. Sitemap Object
Retrieve navigation nodes (menu structure) programmatically.
<ul>
{% for node in sitemap.children %}
<li><a href="{{ node.url }}">{{ node.title }}</a></li>
{% endfor %}
</ul>
Pro Tip: Combine Objects for Real Power
You can mix these objects for powerful results. For example, show a custom greeting only for users in a specific city.
{% assign city = request.params['city'] %}
{% if user and city == 'Hyderabad' %}
<p>Hello {{ user.firstname }}, special offers await you in Hyderabad!</p>
{% endif %}
Test and Debug Liquid
You can use the "Portal Web Template Preview" in Power Pages studio or the browser's developer tools to test your Liquid outputs. Also, using {{ object | json }} helps in debugging.
<pre>{{ user | json }}</pre>
Summary
Here’s a quick recap of the most-used Liquid objects.
Object |
Description |
Example Use Case |
user |
Logged-in user info |
Personalized greeting |
website |
Portal metadata |
Multi-portal site logic |
request |
Query string and form data |
Filter or search functionality |
entities |
Fetch Dataverse records |
Dynamic lists and dashboards |
page |
Current page metadata |
Titles and breadcrumbs |
portal |
Portal-level data |
Language, roles, etc. |
snippets |
Static content pieces |
Reusable messages |
Final Thoughts
Liquid is simple yet powerful – especially in Power Pages, where you want performance, dynamic content, and cleaner code. Mastering these core objects will definitely make your portal apps more flexible and maintainable.
Do try them out and let me know how you're using Liquid in your projects in the comments section!
Happy coding!
Feel free to follow me for more Power Platform tips, tricks, and real-world scenarios.
If you found this helpful, don't forget to hit the Like button and share it with your developer circle!