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 / Hiding and resetting f...
Power Apps
Unanswered

Hiding and resetting fields based on value in dropdown

(0) ShareShare
ReportReport
Posted on by 519

I have a scenario whereby I have a cascading dropdown which works well - so if someone selects an "Incident type" from the first dropdown then respective values from the "Incident type - Sub Category field" are displayed.  This works well.  My scenario is three-fold.  Based on the values selected in the Incident type Sub Category field, the respective fields to populate should be displayed. 

 

So as an example - if someone selects:

Accident from the Incident type dropdown, and from the Sub Category dropdown they select Property Damage, - two other fields should be displayed asking them to describe the property damage and also include an estimate cost.  Similarly, if they select something else from the sub category dropdown, the respective fields should be displayed.  What I also want is if someone selects a sub category and the respective fields are displayed, and they enter text in those fields and they choose another category instead, the already entered text should be reset, as it means they would have selected the wrong category.  I am using a form that has tabs whereby I have set on each data cards visibility property, eg:  currentTab="UpdateIncident" so only the fields for update Incident will be displayed when I select that tab, similarly I have a tab for Risk Ranking and I set currentTab="RiskRank" for all the cards that need to be displayed on that tab. Because under the visible property for each datacard I already have currentTab=xxxx, I am not sure how to nest an if function with this, to show/hide the respective fields based on the value selected.  Finally, I would also have liked to disable submit if based on the hidden fields displayed, if any is blank, disable submit.  Hope this does not sound like a mouthfull, but would appreciate any guidance on how to achieve the above.  Thanks in advance. 

Categories:
I have the same question (0)
  • v-qiaqi@microsoft.com Profile Picture
    Microsoft Employee on at

    Hi@joshieboy,

    Could you please share a bit more about your data card in the form, a screenshot would be appreciated?

    Do you have a tab form?

    Before you provide more details, could you please check the following blog for reference?

    Handling Tab Control Scenarios in PowerApps

    How to create tabbed forms in PowerApps 

    Also, here is a video from @Anonymous Young for your reference.

    https://www.youtube.com/watch?v=if_mFIfi5PM 

    Hope the above could help you.

    Regards,

    Qi

     

  • joshieboy Profile Picture
    519 on at

    Hi Qi, thanks for your response.  Attached you'll find a sample of the screen.  You will see three buttons to the top.  

    • Edit IIN shows the edit form of the submitted record
    • Risk Rank allows you to risk rank the selected form by choosing a likelihood and impact level and allowing the system to generate the Outcome and other values.  These all work well.
    • The Update Incident is the one I attached and this is where depending on an incident type selected from the dropdown - eg:  Incident type could be Accident, Environmental, First Aid etc. the respective options in the Incident type sub category field will be displayed.  This was setup as a cascading menu.  This works well.  The query I have is, when someone selects a Sub category, only certain fields will be displayed - eg.  in the attached you'll see two fields "Please describe property or material damaged or stolen and also a field to include the approx. value.  These fields should only be displayed if someone selects Property Damage from the sub category field.  If they select another option, eg Chemical Spill, the property damaged fields should be hidden and the relevant fields to complete for Chemical Spill should be displayed.  That should be the behavior throughout.  Also, if someone selects Property damage and commences to fill out those fields and then changes their mind and then chooses something else, whatever they would have entered in those previous fields should be erased once they select another category.  
    • I had set a visible property on all the data cards to correspond with the buttons so that eg:  the risk rank button has a OnSelect property to Set current tab as "RiskRank" and the respective data cards have a visibility property of current tab is "risk rank" so that only the relevant data cards are shown when the button is selected.  Thanks for the links above, as I will go through them, but am also not sure if there is a more efficient way to achieve what I did with the buttons.  Guessing that after looking after the video I may get more ideas.  Because each datacard has a visible property of currentTab="Risk Rank" or "Edit IIN" etc., I am not sure how to do the if statements to hide fields and include in the existing visibility property formula.  Any feedback appreciated. 

     

    UpdateIncident.jpg

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 Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 379 Most Valuable Professional

#2
11manish Profile Picture

11manish 203 Super User 2026 Season 2

#3
MS.Ragavendar Profile Picture

MS.Ragavendar 128 Super User 2026 Season 2

Last 30 days Overall leaderboard