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 / Show or hide Fields on...
Power Pages
Answered

Show or hide Fields on the entity forms based on the value in the previous field

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

Hello Community Experts!

 

I have a requirement where I need to show some of the fields on the entity form based on the value selected on the previous field. I have a field which allows the users to select web roles. I need to show/ hide the fields based on the value selected in the web role field. Could anyone please suggest me how to achieve this?

 

Your help is greatly appreciated!

Thank you!

Categories:
I have the same question (0)
  • Verified answer
    v-yutliu-msft Profile Picture
    Microsoft Employee on at

    Hi @Anonymous ,

    Do you use model driven app?

    Do you want to change a field's visibility based on selection of another field?
    If so, there are two solutions.

    1)use business rule

    You would specify the condition and use the set visibility action. There are more details in the help here.

    https://docs.microsoft.com/en-us/powerapps/maker/model-driven-apps/create-business-rules-recommendations-apply-logic-form

    93001.png

     

    2)use JS:

    Please check this blog: Hiding and Showing a Field in Dynamics 365 using JavaScript .

     

     

    Here's a similar issue for your reference:
    https://powerusers.microsoft.com/t5/Building-Power-Apps/Model-Driven-Apps-Different-Form-based-on-Optionset-value/m-p/639423

     

     

    Best regards,

  • oliver.rodrigues Profile Picture
    9,482 Most Valuable Professional on at

    Hi, can you try something like:

    $(document).ready(function () {
     MyFieldChanged();
     $('#<my field>').on("change", MyFieldChanged);
    });
    
    function MyFieldChanged() {
     var selectedValue = $('#<my field>').val();
     if (!!selectedValue && selectedValue == "<my value>") {
     $("#<field name>").closest("td").find("div.control, div.info").hide();
     }
     else {
     $("#<field name>").closest("td").find("div.control, div.info").show();
     }
    }

     

    if you need to hide Sections/TABs, or other things, I have a blog post on this that might help: https://oliverrodrigues365.com/2020/07/19/power-apps-portals-javascript-tip-01-hide-show-elements/


    ------------

    If you like this post, give a Thumbs up. Where it solved your request, Mark it as a Solution to enable other users find it.

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

Season of Sharing Community Challenge Launch!

Jump in, show your community spirit, and win prizes!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the April Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Pages

#1
11manish Profile Picture

11manish 34

#2
Valantis Profile Picture

Valantis 30

#3
omkarsupreme Profile Picture

omkarsupreme 23

Last 30 days Overall leaderboard