Terminal-Style Quick Reference • Input → Output Examples • Pro Tips Included
{% if user.authenticated %}
Welcome, {{ user.fullname }}
{% elsif user.email %}
Hi, {{ user.email }}
{% else %}
Welcome, Guest
{% endif %}
{% for item in entityview.records %}
{{ item.fullname }}
{% endfor %}
{% for i in (1..5) limit:3 %}
Item {{ i }}
{% endfor %}
{% assign my_variable = "Hello World" %}
{% assign total = price | times: 2 %}
{{ my_variable }} - Total: {{ total }}
{{ entity.createdon | date: "dd MMM yyyy" }}
{{ "now" | date: "yyyy-MM-dd HH:mm:ss" }}
{{ "power pages" | upcase }}
{{ "HELLO" | downcase }}
{% assign names = "John,Mary,Tom" | split: "," %}
{{ names | join: " | " }}
{% assign active_users = entityview.records | where: 'statecode', 0 %}
{% for user in active_users %}
{{ user.fullname }}
{% endfor %}
{{ entityview.records | order_by: 'fullname' | join: ', ' }}
{{ entityview.records | order_by: 'fullname', 'desc' }}
{{ page.title }}
{{ page.url }}
{{ page.description }}
{{ page.id }}
{% if user %}
{{ user.fullname }}
{{ user.email }}
{{ user.id }}
{% endif %}
{{ request.url }}
{{ request.path }}
{{ request.params.id }}
{{ request.query }}
{% entitylist name: "Active Contacts" %}
{% for item in entitylist.records %}
{{ item.fullname }} - {{ item.emailaddress1 }}
{% endfor %}
{% endentitylist %}
{% entityview logical_name:'contact', name:'Active Contacts' %}
Total: {{ entityview.total_records }}
{% for contact in entityview.records %}
{{ contact.fullname }}
{% endfor %}
{% endentityview %}
{% fetchxml query %}
<fetch>
<entity name="contact">
<attribute name="fullname"/>
<filter>
<condition attribute="statecode" operator="eq" value="0"/>
</filter>
</entity>
</fetch>
{% endfetchxml %}
{% for contact in query.results.entities %}
{{ contact.fullname }}
{% endfor %}
{% chart id:"EE3C733D-5693-DE11-97D4-00155DA3B01E" viewid:"00000000-0000-0000-00AA-000010001006" %}
{% powerbi authentication_type:"powerbiembedded" path:"https://app.powerbi.com/groups/.../reports/..." %}
{% editable page 'adx_copy' type: 'html', title: 'Page Copy' %}
{% editable snippets 'Header' type: 'html' %}
{% entityform name: 'Contact Form' %}
{% searchindex query: request.params.q, page: request.params.page %}
{% if searchindex.results.size > 0 %}
{% for result in searchindex.results %}
{{ result.title }}
{% endfor %}
{% endif %}
{% endsearchindex %}
{% case page.title %}
{% when 'Home' %}
Welcome home!
{% when 'About', 'Contact' %}
Info page
{% else %}
Other page
{% endcase %}
{% unless user.authenticated %}
Please sign in to continue
{% endunless %}
{% capture greeting %}
Hello {{ user.firstname }}, welcome!
{% endcapture %}
{{ greeting }}
{% for item in items %}
<div class="{% cycle 'red', 'green', 'blue' %}">
{{ item }}
</div>
{% endfor %}
<table>
{% tablerow child in page.children cols:2 %}
{{ child.title }}
{% endtablerow %}
</table>
{% comment %}
This text will not appear in the output.
Use for documentation and notes.
{% endcomment %}
{% raw %}
{{ user.fullname }} will be displayed literally
{% endraw %}
{% if user.fullname == 'Dave Bowman' %}
Hello, Dave
{% endif %}
{% if page.title != 'Home' %}
Not the home page
{% endif %}
{% if entityview.records.size > 10 %}
More than 10 records
{% endif %}
{% if page.children.size < 5 %}
Less than 5 children
{% endif %}
{% if entityview.page >= 1 %}
Valid page number
{% endif %}
{% if entityview.page <= entityview.total_pages %}
Valid page
{% endif %}
{% if user.authenticated and user | has_role: 'Admin' %}
Admin user
{% endif %}
{% if page.title == 'Home' or page.title == 'Index' %}
Home page
{% endif %}
{% if page.title contains 'Product' %}
This is a product page
{% endif %}
{% if page.title startswith 'Profile' %}
Profile page
{% endif %}
{% if page.title endswith 'Forum' %}
Forum page
{% endif %}
{{ 'filename' | append: '.pdf' }}
{{ 'Jane Johnson' | prepend: 'Dr. ' }}
{{ 'power pages rocks' | capitalize }}
{{ 'Hello Dave, how are you Dave?' | replace: 'Dave', 'John' }}
{{ 'Hello, Dave!' | remove: 'Dave' }}
{% assign words = 'This is a test' | split: ' ' %}
{{ words[0] }}
{{ words.size }}
{{ 'This is a long run of text' | truncate: 10 }}
{{ '<p>Hello <strong>World</strong></p>' | strip_html }}
{{ note.notetext | newline_to_br }}
{{ 'Hello Dave, how are you Dave?' | remove_first: 'Dave' }}
{{ 'Hello Dave, how are you Dave?' | replace_first: 'Dave', 'John' }}
{% capture text %}
Line 1
Line 2
{% endcapture %}
{{ text | strip_newlines }}
{{ note.notetext | text_to_html }}
{{ 'This is a long run of text' | truncate_words: 3 }}
{% assign batches = entityview.records | batch: 2 %}
{% for batch in batches %}
{% for item in batch %}
{{ item.fullname }}
{% endfor %}
{% endfor %}
{{ group1 | concat: group2 | join: ', ' }}
{% assign not_redmond = entityview.records | except: 'address1_city', 'Redmond' %}
{% assign groups = entityview.records | group_by: 'address1_city' %}
{% for group in groups %}
{{ group.key }}: {{ group.items.size }} items
{% endfor %}
{% assign names = entityview.records | select: 'fullname' %}
{{ names | join: ', ' }}
{{ entityview.records | first | fullname }}
{{ entityview.records | last | fullname }}
{{ entityview.records | size }}
{{ 'Hello' | size }}
{{ entityview.records | shuffle | join: ', ' }}
{% assign words = 'This is a test' | split: ' ' %}
{{ words | skip: 2 | join: ', ' }}
{% assign words = 'This is a test' | split: ' ' %}
{{ words | take: 2 | join: ', ' }}
{{ entityview.page | plus: 1 }}
{{ entityview.page | minus: 1 }}
{{ 10 | times: 2 }}
{{ 10 | divided_by: 2 }}
{{ 10.0 | divided_by: 3 }}
{{ 12 | modulo: 5 }}
{{ 4.6 | round }}
{{ 4.5612 | round: 2 }}
{{ 4.3 | ceil }}
{{ 4.6 | floor }}
{{ now | date_add_days: 7 | date: 'yyyy-MM-dd' }}
{{ now | date_add_days: -30 | date: 'MMMM dd' }}
{{ now | date_add_hours: 2 | date: 'HH:mm' }}
{{ now | date_add_months: 3 | date: 'MMMM yyyy' }}
{{ now | date_to_iso8601 }}
{{ now | date_add_minutes: 30 | date: 'HH:mm' }}
{{ now | date_add_seconds: -10 | date: 'HH:mm:ss' }}
{{ now | date_add_years: 1 | date: 'yyyy' }}
{{ now | date_to_rfc822 }}
{{ '<img src="x" onerror="alert(1)">' | html_safe_escape }}
{{ '<product>Widget</product>' | xml_escape }}
{% assign is_valid = 'true' | boolean %}
{% if is_valid %}Valid!{% endif %}
{% assign price = '19.99' | decimal %}
{{ price | times: 1.1 }}
{% assign count = '42' | integer %}
{{ count | plus: 8 }}
{% assign num_str = 42 | string %}
{{ num_str | append: ' items' }}
{{ '/page' | add_query: 'id', '123' }}
{{ 'https://example.com/page?id=1' | base }}
{{ request.url | host }}
{{ 'https://example.com/products/item' | path }}
{{ 'https://example.com/page?id=1' | path_and_query }}
{{ 'https://example.com:8080/page' | port }}
{{ '/page?id=1&name=test' | remove_query: 'id' }}
{{ request.url | scheme }}
{{ user.fullname | default: 'Guest' }}
{{ 1024 | file_size }}
{{ 1536000 | file_size }}
<input value="{{ user.fullname | h }}">
{% if user | has_role: 'Administrators' %}
Admin content
{% endif %}
{% assign template = 'Hello {{ user.firstname }}' %}
{{ template | liquid }}
{% assign account = entities.account['936DA01F-9ABD-4d9d-80C7-02AF85C822A8'] %}
{% if account %}
{{ account.name }}
{% endif %}
{{ settings['Header/Logo/Image'] }}
{{ settings['Authentication/Registration/Enabled'] }}
{{ snippets['Footer/Copyright'] }}
{{ snippets['Home/Welcome Message'].adx_value }}
{{ now | date: 'MMMM dd, yyyy HH:mm' }}
{{ user.fullname | escape }}
{{ '<script>alert("XSS")</script>' | escape }}
{{ 'Hello World!' | url_escape }}