cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
PowerappsUser5
Helper II
Helper II

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

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!

1 ACCEPTED SOLUTION

Accepted Solutions
v-yutliu-msft
Community Support
Community Support

Hi @PowerappsUser5 ,

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-recommendat...

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-Op...

 

 

Best regards,

Community Support Team _ Phoebe Liu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

2 REPLIES 2
v-yutliu-msft
Community Support
Community Support

Hi @PowerappsUser5 ,

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-recommendat...

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-Op...

 

 

Best regards,

Community Support Team _ Phoebe Liu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

OliverRodrigues
Super User
Super User

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.




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.

Power Apps Portals Super User


Oliver Rodrigues


 

Helpful resources

Announcements
PA_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

secondImage

Power Apps Community Call

Please join us on Wednesday, October 20th, at 8a PDT. Come and learn from our amazing speakers!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

Welcome Super Users.jpg

Super User Season 2

Congratulations, the new Super User Season 2 for 2021 has started!

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

Users online (2,216)