Thank you for taking the time to read my question.
I have an edit for and I want to change the color of a Combobox border if the value in the ComboBox does not match the saved value;
PelMed = ComboBox
If(frmPelleting.Mode = FormMode.Edit && ThisItem.Medication <> Concat(PelMed.SelectedItems,Title,","),Orange, Parent.BorderColor)
This does not work because Concat(PelMed.SelectedItems,Title,",") returns a list of commas I'm finding.
I've read that SelectedItems does not equal DefaultSelectedItems... and SelectedItems does not get set until the user interacts with the ComboBox.
I also tried Concat(PelMed.DefaultSelectedItems,",") but there is no such thing...
How do I tell if the user made a change to the ComboBox vs. the previously saved record?
Solved! Go to Solution.
Here is the Items code:
Filter(Medication,Or(MedicationFacility = SelectedFacility.Text,MedicationFacility = "All"),Or(MedicationLine = BagLine.Selected.Line,MedicationLine = "All"),IsActive).Title
I get Red Underline if I change Title to Value.
Not sure if this is helpful, but the DefaultSelectedItems =
And when I expand the ComboBox, the values in the DefaultSelectedItems for the ComboBox are not highlighted... like there is a disconnect somewhere...
Maybe that's why I'm not getting anything when I use Concat() on the ComboBoxes SelectedItems field?
Ok, I have it!
Power Apps Combo Box DefaultSelectedItems - YouTube - Here Shane makes an important point at 3:10 of the video. The data source has to be the same table for DefaultSelectedItems and Items. That's where my solution fell apart.
So I changed my DefaultSelectedItems to:
//RenameColumns(Filter(Split(Parent.Default,","),!IsBlank(Result)),"Result","Value") Filter(Medication,Title in Split(Parent.Default,",").Result,MedicationFacility = SelectedFacility.Text, MedicationLine = PelLine.Selected.Line)
Then I changed my BorderColor formula to:
If(frmPelleting.Mode=FormMode.Edit && ThisItem.Medication <> Concat(PelMed.SelectedItems.Title,Title & ","),Orange, Parent.BorderColor)
Voila!! no more Orange border.
Thank you so much @StalinPonnusamy for all your replies to my post. I really appreciate it.
Learn how to create your own user groups today!
Check out the new Power Platform Community Connections gallery!
Join us, in-person, December 7–9 in Las Vegas, for the largest gathering of the Microsoft community in the world.