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 / Conditional visibility...
Power Apps
Unanswered

Conditional visibility for the section based on the selected item

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

Hello,

 

I have an issue with conditional visibility. The task looks pretty simple, but I don't understand why it doesn't work:

 

I have a section with a label and form that should be only visible if a user chooses "Line 2" in the Combo box at the first section. So, for the Visible property for this section I wrote:

 

If("Line 2" in DataCardValue2.SelectedItems.Value, true, false).

 

But as you can see on the screenshot - the section just disappeared and nothing happens if I choose or not "Line 2" in the field.

 

I also tried to use a variable and then set the function for the OnChange property:

 

Switch(DataCardValue2.Selected.Value,"Line 2",UpdateContext({cVisible: true}))

 

But the result is the same - the section just disappeared.

 

Any help is appreciated.
Thank you!

visible_formula.png
Choices.png
Categories:
  • hemrhk Profile Picture
    361 on at

    @Anonymous 

    Try this,

    If(DataCardValue2.Selected.Value = "Line 2", true, false)

     

    ------------------------------------------------------------------------------------------------- 

    If it solved your problem give a kudo and accept it as a solution. 

    Follow and Subscribe 365 Stack for more updates. 

     

  • v-qiaqi@microsoft.com Profile Picture
    Microsoft Employee on at

    Hi @Anonymous,

    Does your DataCardValue2 allow multi select or not?

    I have a test on my side and it works as expected.

    Please share a bit more about your scenario.

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Hi @v-qiaqi-msft 

    DataCardValue2 doesn't allow multi select.

     

    The structure of this screen is in the screenshot. The scenario is: section "KPI_input" should appear only after "Line 2" is picked in DataCardValue2. 

    CanvasStructure.png

    But if I, for example, create some additional DataCard inside the "Intro_Form" and apply for this item the same condition based on DataCardValue2 - visibility works as it has to be.

     CanvasStructureTest.png

    So now I am not sure if PowerApps allows applying this kind of condition to items that are not on the same structure level, because it doesn't work in my case no matter what I've tried.

  • v-qiaqi@microsoft.com Profile Picture
    Microsoft Employee on at

    Hi @Anonymous,

    Okay, that's kind of clear.

    Recently, we found that the value within the form could not be read from time to time, which is a bug. Our colleague have already been working on this issue. I will post here if there is any updates.

    Thanks for your cooperation.

     

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

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 342 Super User 2026 Season 2

#2
M Bilal Khan Profile Picture

M Bilal Khan 271

#3
Mohsin Ali Profile Picture

Mohsin Ali 239

Last 30 days Overall leaderboard