web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Pages / Help with Liquid to sh...
Power Pages
Answered

Help with Liquid to show/hide form based on user

(0) ShareShare
ReportReport
Posted on by 48

I found a couple of blogs that describe this; however, I cannot get it to work. Requirement: show form to users who are associated with an account. If no account record, show some text. I followed this: https://www.engineeredcode.com/blog/dynamics-365-portal-using-liquid-to-create-conditional-entity-forms

 


{% if user.account != blank %}
    {% entityform name: 'Form Name' %}
{% else %}
    Some text here
{% endif %}
 
I used something similar to populate the user and their associated account on another page with a content snippet and it worked. For this I'm used a web template and it shows the form no matter what. I also tried this at the beginning and switching user to contact:
 
{% assign contact = entities['contact'][request.params.contactid] %}
 
How can I make this work? Seems I'm missing something.
Categories:
I have the same question (0)
  • Verified answer
    oliver.rodrigues Profile Picture
    9,425 Most Valuable Professional on at

    hi, it seems your code is trying to compare the user.account object to blank

    blank in this case doesn't exist, it isn't a liquid object.. so it's just a code syntax mistake

     

    try something like 

    {% if user.account %}
    // show entity form....
    {% else %}
    // ....
    {% endif %}

    for more liquid information you can look at this: https://docs.microsoft.com/en-us/powerapps/maker/portals/liquid/liquid-types

     

  • JEM123 Profile Picture
    48 on at

    I knew it would be something simple. 😅 That worked perfectly. Thank you for the help. 

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Leaderboard > Power Pages

#1
Hammed Profile Picture

Hammed 22

#2
Lucas001 Profile Picture

Lucas001 21 Super User 2026 Season 1

#3
CN-06091549-0 Profile Picture

CN-06091549-0 18

Last 30 days Overall leaderboard