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 / Hide field in Power Pa...
Power Pages
Unanswered

Hide field in Power Pages form if it contains data

(0) ShareShare
ReportReport
Posted on by 8

Hello!

I would like to hide a lookup field from the profile page form once it contains data.

After the user is registered, they are forced to complete their profile, and one of these fields is a lookup to the account table that sets the company of the contact. I don't want the user to be able to change it after it is set. Initially I wanted the field to be available in the registration form, but that seems borderline impossible. The next best thing I can think of right now is to hide or lock the field once it contains data.

 

I tried adding a Business Rule to the form and field, and thought that must be it! Unfortunately the Business Rule does not trigger when the user makes a change on their profile page, so the field will not be hidden, no matter which configuration I build.

 

Is it possible to hide the field if it contains data?

Categories:
I have the same question (0)
  • oliver.rodrigues Profile Picture
    9,368 Most Valuable Professional on at

    You need to apply JS on the Portal to achieve this

    See if this article helps: http://oliverrodrigues365.com/2020/07/19/power-apps-portals-javascript-tip-01-hide-show-elements/

     

  • Hagru Profile Picture
    8 on at

    Hi @OliverRodrigues 

    I came across your article when looking for a way to do this, but I still feel like I am missing some pieces.

     

    First thing is, it's a Profile form. Where do I navigate to add custom JS to this form in the first place?

    Second is, I don't want to hide the field until it has been submitted with data. How can I check this, and hide it appropriately?

     

    EDIT: 

    Nevermind, I figured the first step out, and I am successful in adding JavaScript to hide the field. I would still like to get some input into how I can hide, or even better, make it readonly once it is submitted with data. The field is a lookup, and is required, and I am forcing the user to fill it after initially creating their account.

  • Verified answer
    oliver.rodrigues Profile Picture
    9,368 Most Valuable Professional on at

    Great you got it working, to make fields read-only you can reference the following article: http://oliverrodrigues365.com/2020/08/16/power-apps-portals-javascript-tip-02-set-attributes-read-only/

     

    if you are happy with this, can you mark it as the solution?

    thanks 

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
Jerry-IN Profile Picture

Jerry-IN 71

#2
Fubar Profile Picture

Fubar 62 Super User 2025 Season 2

#3
sannavajjala87 Profile Picture

sannavajjala87 31

Last 30 days Overall leaderboard