Power Pages Liquid – Basics

Liquid Basics in Power Pages

Learn how Liquid syntax, filters, and tags work in Power Pages.

Liquid is a templating language recognizable by two sets of delimiters: {{ }} for output and {% %} for logic and control flow.

Output Statements

Output statements display values from objects or text inside double braces.

Hello {{ user.firstname }} from {{ 'Power Pages' }}

If the current user’s first name is Doug, this would produce:

Hello Doug from Power Pages

This demonstrates how static text and dynamic values combine.

Using Filters

Filters modify output values. They are added using the pipe (|) symbol.

Hello {{ user.firstname | upcase }} from {{ 'Power Pages' }}. The date is {{ 'now' | date: 'MMMM d yyyy' }}

This example uses the upcase filter to convert text to uppercase and the date filter to show a formatted current date.

Tags for Logic and Control Flow

Logic tags let you define variables and conditional content.

{% assign product = 'Power Pages' %}

{% if user %}
Hello, {{ user.firstname | upcase }}, from {{ product }}.
{% else %}
Greetings, visitor, from {{ product }}!
{% endif %}



This uses assign to define a variable, and if…else for conditions based on whether a user is signed in.

Time Example

You can show the current time using the date filter:

The time is {{ 'now' | date: 'g' }}

Power Pages evaluates this on the server and displays the local time format. 

Summary

Liquid basics in Power Pages include output expressions, filters to modify output, and tags for logic and variables. These fundamentals are key for building more complex dynamic content in your portals.

Comments

Popular posts from this blog

Part 1: Creating Code Apps in Power Apps - A step-by-step guide (with real errors I faced & how I fixed them)

Calling Microsoft Graph API from Power Automate Using Azure App Services – Step-by-Step Guide

Step-by-Step Guide: Power Automate Custom Connector Using Graph API from Azure App Service