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 / Labels tied to certain...
Power Apps
Unanswered

Labels tied to certain dropdown fields are not executing conditional formatting. How do I fix?

(0) ShareShare
ReportReport
Posted on by 831 Moderator

I have a 'summary' container that has several labels that are tied the fields in my form. I have formatting for the fill of these labels that looks like this:

 

If(IsBlank(CB_Industry.Selected.'Industry Name') && DC_Industry.Required = true, RGBA(253, 222, 207, 1), RGBA(255,255,255,1))

 

This works fine if I am filling for form out for the first time. The labels are blank and they are filled with the correct color. Once a selection is made in the corresponding combo box then the field's fill changes to white. My issue is when I populate the form with data from a global variable. The form field fill in correctly but the labels don't populate with the same data and the color remains pink (in this case) and do not turn to white. This is the code I am using for the Text property of the labels:

 

 

CB_Industry.Selected.'Industry Name'

 

 

For DefaultselectedItems for the combo boxes I am using

 

 

[Parent.Default]

 

 

Any idea what is happening? 

 

Categories:
I have the same question (0)
  • kelseytran Profile Picture
    292 on at

    Hi @futr_vision ,

    This is probably because the conditional formatting is not being re-evaluated when the form is populated w/ data from the global variable.  You can force these labels to re-evaluate their conditions by

    Making sure the 'DefaultSelectedItems' property of the combobox is correctly referencing the data:

    DefaultSelectedItems: 
    If(IsBlank(Parent.Default), Blank(), [Parent.Default])

    Updating the context variable to trigger re-evaluation:

    Set(glbCopiedRecord, LookUp(SourceTable, ID = SelectedRecordID));
    UpdateContext({varRevalidate: Now()});

    Using the context variable in the conditional formatting:

    Fill: 
    If(
     IsBlank(CB_Industry.Selected.'Industry Name') && DC_Industry.Required = true && varRevalidate, 
     RGBA(253, 222, 207, 1), 
     RGBA(255, 255, 255, 1)
    )

    Make sure the context variable is updated when the screen becomes visible or the form is populated:

    OnVisible: 
    UpdateContext({varRevalidate: Now()});
    

    And making sure the text property of the labels is correctly referencing the combobox selection:

    Text: 
    CB_Industry.Selected.'Industry Name'

    ------------------------------------------------------------------------------------------------------------------------------
    If I answered your question, please accept my post as a solution and if you liked my response, please give it a thumbs up.

    Thanks!

  • futr_vision Profile Picture
    831 Moderator on at

    Thanks. Looking over all of the labels with the conditional formatting I do find some that work fine. That is only when the value it is accessing is in the format of ControlName.Selected.Value. If it is in the format ControlName.Selected.ColumnName then it fails.   

  • futr_vision Profile Picture
    831 Moderator on at

    Actually, that is not completely true. I do have one label that populates with data but the formatting is broken

  • futr_vision Profile Picture
    831 Moderator on at

    @kelseytran 

     

    Set(glbCopiedRecord, LookUp(SourceTable, ID = SelectedRecordID));
    UpdateContext({varRevalidate: Now()});

     

     

    glbCopiedRecord is a new variable? I already have this on the copy button

    Set(
     glbFormData,
     GAL_Campaigns.Selected
    );

     

    For ID= SelectedRecordId, what do I use? 

  • futr_vision Profile Picture
    831 Moderator on at

    I'm also finding that this code is causing and issue. The varRevalidate. Invalid argument type

     

    Fill: 
    If(
     IsBlank(CB_Industry.Selected.'Industry Name') && DC_Industry.Required = true && varRevalidate, 
     RGBA(253, 222, 207, 1), 
     RGBA(255, 255, 255, 1)
    )

     

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

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 335 Most Valuable Professional

#2
11manish Profile Picture

11manish 165

#3
MS.Ragavendar Profile Picture

MS.Ragavendar 96 Super User 2026 Season 1

Last 30 days Overall leaderboard