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 Apps / Visibility - Fields sh...
Power Apps
Unanswered

Visibility - Fields showing when they shouldn't

(0) ShareShare
ReportReport
Posted on by 245

Hi,

 

I have a powerapp which allows items to be created and added to a SharePoint list. When viewing / editing those items from SharePoint, there are fields which should be hidden or shown depending if a toggle switch is either on or off. My issue is all fields are showing regardless whether the toggle switch is on or off.

 

Thanks for your help!!

Categories:
I have the same question (0)
  • RandyHayes Profile Picture
    76,299 Super User 2024 Season 1 on at

    @MiniMe_83 

    Can you share any formulas you have that are suspect?

    In general the Visible property on your DataCards (assuming this is an EditForm) should be set to yourToggle.Value

     

    I hope this is helpful for you.

  • MiniMe_83 Profile Picture
    245 on at

    Hi @RandyHayes ,

     

    Thanks for the quick turn around, I have the following formulas associated to the fields either being hidden or shown.

     

    DataCard 1_2 is a single line text box which has a number from 1-10 entered into it. Depending the number, this will show the relevant product lines.

     

    For example, if 2 is entered into datacard 1_2, 2 product line (name, cost, brand etc) will appear. Also in the product line there is a toggle switch for extras. If turned on, this will reveal another field for the user to enter more details.

     

    The screen On visible is: UpdateContext({vQty:Value(DataCardValue1_2.Text)})

     

    DataCard1_2, the OnChange for this is: UpdateContext({vQty:Value(DataCardValue1_2.Text)})

    The default for 1_2 is Parent.Default.

     

    Each product line field, the visible setting is "vQty>0",  this includes the toggle switch on each product line. The value increases every product line i.e "vQty>1, vQty>2 .... and so on. This part works.

     

    The visible setting of the field which is either hidden or shown is set to: 

     

    vQty>0 && If(DataCardValue5_2.Value = true, true)   - 5_2 is the toggle switch

     

    If you need anything further please let me know.

     

    Thanks for helping

  • MiniMe_83 Profile Picture
    245 on at

    @RandyHayes 

     

    I will mention that the form loads as it should for a split second then all field that shouldnt be shown appear. Also, when editing the edit form, by pressing Alt or playing the form, it all works as it should do. Its a head scratcher. 

     

    Thanks again

  • MiniMe_83 Profile Picture
    245 on at

    @RandyHayes Capture1.PNG

    The red indicates the datacard 1_2 showing certain fields including the toggle switches, the blue shows the toggle switch on with the relevant field showing, the black shows the toggle switch is off but the field is still being displayed. Hopefully this paints a better picture.

     

    Thanks again

  • RandyHayes Profile Picture
    76,299 Super User 2024 Season 1 on at

    @MiniMe_83 

    There seems to be some disconnect on the terminology you are using.  You mention DataCard1_2 has an OnChange action - DataCards don't have actions, so you must be referring to something else.

    In your picture, what is DataCardValue1_2, is that the top textinput where you have 5?

     

    In general, you don't need any variables or OnChanges for this all to happen.  Simply refer to the datacardvalue field in your formulas.

    For example,. set your Visible properties like this:

       Value(DataCardValue1_2.Text) > 0

    This will let you get rid of all of the variables and the OnChange actions...they are just extra stuff you don't need.

     

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 May Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
Valantis Profile Picture

Valantis 483

#2
WarrenBelz Profile Picture

WarrenBelz 399 Most Valuable Professional

#3
11manish Profile Picture

11manish 327

Last 30 days Overall leaderboard