cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
HarminderSethi
Frequent Visitor

How to show/hide Section or Tab in model-driven apps using business rules?

 
1 ACCEPTED SOLUTION

Accepted Solutions

Hi @HarminderSethi

Yes, you can hide/show/required/optional fields using Business Rules and Hide/show tab or section using JavaScript.

 

Please mark as solution if this helps you! 

View solution in original post

6 REPLIES 6
hardikv
Memorable Member
Memorable Member

Hi @HarminderSethi

YYou can not hide show tab or section using business rule.

You need to use javascript for hide show tab or section. 

 

function hideTab(executionContext) {
formContext = executionContext.getFormContext();
var tabObj = formContext.ui.tabs.get("tabname");
tabObj.setVisible(false);
//For show tab
//formContext.ui.tabs.get("tabname");
tabObj.setVisible(true) ;

 

Please review ms doc:

https://docs.microsoft.com/en-us/powerapps/developer/model-driven-apps/clientapi/reference/formconte...

Thanks @hardikv i went through this artical intially and thought may be the docuentaion is not updated or i am missing something.

 

I think this feature should be added as there are times when we need to show/hide the complete section based on the condition and need to make the fields required or optional within the section. Now fields can be made required/optional or show/hide using business logic but just to show/hide the section we have to use the code/javascript.

Hi @HarminderSethi

Yes, you can hide/show/required/optional fields using Business Rules and Hide/show tab or section using JavaScript.

 

Please mark as solution if this helps you! 

vipinjaiswal12
New Member

I have created some Generic Method to Hide and Show Tab and Section

Please refer here : https://vjcity.blogspot.com/2021/07/generic-method-to-hide-and-show-tab-and.html

awesome. I have emailed you for more info. Much appreciated.

Karrar
Regular Visitor

You could hide an entire section using business rules by adding the fields you want to hide and show at the same time into the section and hiding the section label. Then using a business rule to hide all fields based on certain criteria or show all fields. That will hide and show the entire section. 

I have created a quick video to demonstrate this.

https://www.youtube.com/watch?v=-X-3cXDBbzI&t=21s

Helpful resources

Announcements
Power Apps News & Annoucements carousel

Power Apps News & Announcements

Keep up to date with current events and community announcements in the Power Apps community.

Community Call Conversations

Introducing the Community Calls Conversations

A great place where you can stay up to date with community calls and interact with the speakers.

Power Apps Community Blog Carousel

Power Apps Community Blog

Check out the latest Community Blog from the community!

Top Solution Authors
Top Kudoed Authors
Users online (2,408)