I'm doubting if this is possible in PowerApps. I have a simple lookup fields with a few value.
When some select "Sales", i want to change to color of the text or combo box to red, etc.
If(ThisItem.RecordType.Value = "Verkoop", Orange, ThisItem.RecordType.Value = "Risk", Red, ThisItem.RecordType.Value = "Dependency", Blue, Black)
I changed the color of the RecordType datacard but nothing happends. So, is it correct you can't change the color of a combo box with a sertain value?
Solved! Go to Solution.
I would suggest changing the properties of the ComboBox itself instead of the DataCard. Not all properties of the ComboBox are linked to the Parent DataCard by default. Some suggested properties to change are Fill (background color), Color (text color) and Border (border Color).
Also, you might need to use the IN operator rather than the equals sign in your conditional statement.
If( "Verkoop" in ThisItem.RecordType.Value, Orange, "Risk" in ThisItem.RecordType.Value, Red, "Dependency" in ThisItem.RecordType.Value, Blue, Black )
Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."
This formula uses scope, which is not presently supported for evaluation. Data type: Color.
Think this looks the problem when i use the IN operator
Fair enough. What happens when you use the equals operator but directly change the Fill, Color or Border properties of the ComboBox NOT the DataCard?
If( ThisItem.Bedrijfsunit.Value = "Verkoop", Orange, ThisItem.Bedrijfsunit.Value = "Eigendom", Red, ThisItem.Bedrijfsunit.Value = "Inkoop", Blue, Black )
When i use this, the combox is and stays black, so it looks the code is only working for the black color.
Very strange because the values are correct.
Do you have any other options than .Value when the autocomplete appears?
You might also want to test by putting ThisItem.Bedrijfsunit.Value in the Text property of a label to see what it returns. The label must be in the same DataCard as the ComboBox
This worked perfectly for me, however I'm having another issue and I can't for the life of me figure out where this property is. The background color changes as I wish, however once the choice field has a selection made, that selection text is highlighted in gray. So if I select Green, the valuecard has a green background, but the word "green" itself has a gray background. So ugly! Any idea what I might be missing?
Learn how to create your own user groups today!
Check out the new Power Platform Community Connections gallery!
Congratulations, the new Super User Season 2 for 2021 has started!
Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.