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

Notifications

Announcements

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)
  • JEM123 Profile Picture
    48 on at

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

  • Verified answer
    oliver.rodrigues Profile Picture
    9,368 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

     

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Pages

#1
Fubar Profile Picture

Fubar 58 Super User 2025 Season 2

#2
Jerald Felix Profile Picture

Jerald Felix 27

#3
Lucas001 Profile Picture

Lucas001 25 Super User 2025 Season 2

Last 30 days Overall leaderboard