web
You’re offline. This is a read only version of the page.
close
Skip to main content
Community site session details
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.
  • 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

     

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Telen Wang – Community Spotlight

We are honored to recognize Telen Wang as our August 2025 Community…

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Pages

#1
Fubar Profile Picture

Fubar 62 Super User 2025 Season 2

#2
Lucas001 Profile Picture

Lucas001 48 Super User 2025 Season 2

#3
KevinGador Profile Picture

KevinGador 44 Super User 2025 Season 2

Loading complete