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 Apps / Set Default tab based ...
Power Apps
Answered

Set Default tab based on field value in a model-driven app

(0) ShareShare
ReportReport
Posted on by 6,678 Moderator

Hello,

 

Is it possible to set the default tab (section) in Dataverse form based on a preexisting value in one of the form's field? 

 

My case: Based on the Value in Field A set default Tab as to either GSP Validation or CTFO Validation?

 

AhmedSalih_0-1652966545801.png

 

Thank you

 

I have the same question (0)
  • Verified answer
    Drew Poggemann Profile Picture
    9,287 Most Valuable Professional on at

    Hi @AhmedSalih ,

     

    Is the following post helpful?  Shows JavaScript to set Default Tab and maybe you can evaluate your field in the JavaScript as well to set the appropriate tab?

    https://community.dynamics.com/365/sales/f/dynamics-365-for-sales-forum/408237/change-default-tab-on-an-entity 

  • AhmedSalih Profile Picture
    6,678 Moderator on at

    @dpoggemann , just for the other community members reference, I have created the script to hide a form's tab based on the value of field on the form:

     

     

     

    function HideTestTab(executionContext) {
     var formContext = executionContext.getFormContext();
     var action = formContext.getAttribute('action').getValue(); //This is a choice column so the value is the number value -- action is the logical name of the column
     var tabToHide = formContext.ui.tabs.get('tab_test'); //tab_test is the name of the tab
    
     if (action == '100000005') //Value of selected item in a choice column, if a text value, type the text value instead
     {tabToHide.setVisible(false);} 
     else
     {tabToHide.setVisible(true);} 
    
    }

     

     

     

    Note: To set a tab as default, we can use the .setFocus instead of .setVisiable >> https://docs.microsoft.com/en-us/power-apps/developer/model-driven-apps/clientapi/reference/formcontext-ui-tabs/setfocus

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 Apps

#1
WarrenBelz Profile Picture

WarrenBelz 765 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 343 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 272

Last 30 days Overall leaderboard