@carrie-anne27 -
Short answer:
Try using applying the below to the DefaultSelectedItems property of the Combobox. Do not modify the Default property of the DataCard.
LookUp(
'Facility IDS',
'Your Column From Facility IDS' = Parent.Default
)
Long answer:
Typically, we create a Single Line Text Column in our data source, and then insert that Single Line Text Column into an EditForm control as a DataCard. We then remove the Text Input control inside the DataCard, and replace it with a different control (in your scenario, a Combobox control).
We also set the Update property of the DataCard to point at the selected value from that Combobox. I assume you have done this.
The ComboBox is expecting a Table. As a workaround, users typically force a display "Value" into the DefaultSelectedItems property using:
{
Value: Parent.Default
}
However, this approach does not work with Dataverse. As you have noticed, if you add a Label control and reference the ComboBox , even though a value is “displayed”, the Text will still return blank. This is will because we are supposed to pass a record into the control because that is what the ComboBox control expects.
In many scenarios, this may not be an issue because we are confident that the correct value is being displayed. We know if the user selects a different value, the ComboBox will accept the selected item as a record and the selection will successfully save to our data source.
However, if we are leveraging the existing selection currently displayed to do anything else, we run into trouble. For example, we may not be able use something like “!Parent.Valid” on the Visible property of a Star label. This is because the Valid property is looking for a record.
To accommodate this, we can force the correct record into the ComboBox using Lookup.