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

Community site session details

Session Id : W7p01gelJgCbLANFZx8QkA
Power Pages - Power Apps Portals
Answered

Help with Liquid to show/hide form based on user

Like (0) ShareShare
ReportReport
Posted on 20 Jul 2021 21:45:56 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.
  • JEM123 Profile Picture
    48 on 21 Jul 2021 at 12:32:13
    Re: Help with Liquid to show/hide form based on user

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

  • Verified answer
    oliver.rodrigues Profile Picture
    9,342 Most Valuable Professional on 20 Jul 2021 at 22:12:10
    Re: Help with Liquid to show/hide form based on user

    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

Announcing our 2025 Season 2 Super Users!

A new season of Super Users has arrived, and we are so grateful for…

Paul Stork – Community Spotlight

We are honored to recognize Paul Stork as our July 2025 Community…

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Pages

#1
Lucas001 Profile Picture

Lucas001 60 Super User 2025 Season 2

#2
Fubar Profile Picture

Fubar 55 Super User 2025 Season 2

#3
surya narayanan Profile Picture

surya narayanan 35

Loading complete