cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Helper I
Helper I

Visibility Conditions not working properly

Good day!

 

This is gonna be a long read, but I hope you find this as a challenge also because I've been searching through the depths of my brain for the answer these past few days.

 

I have this card "cardWPSignsAdequateActionTaken" with a label text "Action Taken" from a form that has a visibility condition of:

 

 

If(
    cardFirebreaksWaterPoints.Visible = true &&
    tglFirebreaksWaterPoints.Value = true &&
    cardWPSignsAdequateFollowupActionRequired.Visible = true &&
    tglWPSignsAdequateFollowupActionRequired.Value = false,
    true,
    false
)

 

 

 

This condition relies on the value of 2 toggle buttons and also the visibility of the cards they are in to also consider not just their value, but also if they are really supposed to be showing.

 

The card "cardFirebreakWaterPoints" has a visibility condition set as

 

 

true

 

 

The card "cardWPSignsAdequateFollowupActionRequired" has a visibility condition set as

 

 

If(
    cardFirebreaksWaterPoints.Visible = true &&
    tglFirebreaksWaterPoints.Value = true &&
    cardWPSignsAdequate.Visible = true &&
    tglWPSignsAdequate.Value = false,
    true,
    false
)

 

 

 

I know this is quite hard to follow, but this is the visibility condition for the card "cardWPSignsAdequate"

 

If(
    cardFirebreaksWaterPoints.Visible = true &&
    tglFirebreaksWaterPoints.Value = true,
    true,
    false
)

 

 

To make it easier for everyone, I created a label field that will show the values of the cards visibility and toggle buttons (for logging purposes) to see if the visibility condition were met:

 

 

 

"cardFirebreaksWaterPoints: " & cardFirebreaksWaterPoints.Visible &
"  tglWPSignsAdequate: " & tglWPSignsAdequate.Value &
"  tglFirebreaksWaterPoints: " & tglFirebreaksWaterPoints.Value &
"  cardWPSignsAdequateFollowupActionRequired: " & cardWPSignsAdequateFollowupActionRequired.Visible &
"  tglWPSignsAdequateFollowupActionRequired: " & tglWPSignsAdequateFollowupActionRequired.Value

 

 

 

 

Okay, so here is where the trouble comes in. When I checked on the card that I mentioned in the beginning, it was appearing on the form. But when checking the loggings from the label I created, the values returned should tell us that the card is not supposed to be visible.

Check loggings on the label belowCheck loggings on the label below

Checking the logging values found on the screenshot above, the values notable for the visibility of the "Action Taken" field are

 

    cardFirebreaksWaterPoints.Visible: true
    tglFirebreaksWaterPoints.Value: true
    cardWPSignsAdequateFollowupActionRequired.Visible: false
    tglWPSignsAdequateFollowupActionRequired.Value: false

 

 

So if we check back the visibility condition of the "Action Taken" field, it should return "false" since the value of cardWPSignsAdequateFollowupActionRequired.Visible returned on the logging label is false.

Whereas in its visibility condition, it was expecting it as true before it appears.

 

So clearly, even if it didn't meet the conditions, the card still appeared.

 

To make the scenario more confusing, let me tell you how I ended up with this.

Before you proceed reading, let me enlighten you that the evidence above clearly shows us that there was something wrong already on the appearance of the card since it wasn't supposed to be visible because the logging said otherwise.

Anyway, this form is handling offline data by saving drafts into a collection.

So first this I did was created a new form, then saved it as draft using Collect functionality.

Then, I edited the draft by editing the same form which is now using the BrowseGallery1.Selected item, which is this exact item I created a while ago.

On this phase, the "Action Taken" field is now showing as expected.

Now, I saved the changes of the draft by using Patch functionality which targets on the same item, BrowseGallery1.Selected.

Then, I tried editing the same item again, then voila, the issue now appeared.

 

I don't know what happened here, but the point is, the values from the loggings tell us that the visibility of the "Action Taken" field is not supposed to appear, but its behavior showed us otherwise.

 

I can provide more information about this if ever you reached up to this point.

 

Have a nice day!

K.D.

0 REPLIES 0

Helpful resources

Announcements
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

News & Announcements

Community Blog

Stay up tp date on the latest blogs and activities in the community News & Announcements.

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Community Highlights

Community Highlights

Check out the Power Platform Community Highlights

Top Solution Authors
Top Kudoed Authors
Users online (12,276)