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 / Hide same control on 2...
Power Apps
Unanswered

Hide same control on 2 tabs using JavaScript

(0) ShareShare
ReportReport
Posted on by 180


‘hello,

 

I have btc field on form on Tab1 and Tab2 , same control on 2 separate tabs

when I am using below code it is hiding on default Tab1 but not tab2 , How can I hide same control on both tabs using below code?

function hideControlBasedOnCondition(executionContext)

{ var formContext = executionContext.getFormContext();

var conditionMet = true;

var control = formContext.getControl("btc");

if (conditionMet) {

control.setVisible(false);

else {  control.setVisible(true); } }

 

Thanks,

I have the same question (0)
  • ChrisPiasecki Profile Picture
    6,422 Most Valuable Professional on at

    Hi @Shafdev,

     

    You can iterate through all controls bound to a column on a form.

     

    formContext.getAttribute("<attributeName>").controls.forEach(control => control.setVisible(false));

     

    Replace <attributeName> with the logical name of your column.

     

    ---
    Please click Accept as Solution if my post answered your question. This will help others find solutions to similar questions. If you like my post and/or find it helpful, please consider giving it a Thumbs Up.

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 711 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 319 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard