I have a typical canvas App that has a Gallery. Its data source is a table of SQL Server. The gallery is editable. We can change a field New Patient directly in the Gallery; it is available as Dropdown:
The Allowed Values for the dropdown are [Blank(), "Y", "N"] in App. The corresponding column in the DB table is NULLable. A user also can open a EditForm (for a selected Gallery row) and modify the field New Patient there (as a Dropdown component):
I have met a problem when the field has NULL (blank) value. The scenario is the following:
I am in the Gallery. There is a row where the New Patient field is “Y”:
I change (being in the Gallery) the dropdown selected value from "Y" to blank. Then I look at the DB table and see – yes, the corresponding row has acquired value NULL, as expected. Then I open the Form and see that the New Patient field displays value Y, not blank. Then I (without modifying anything in the Form) close the Form; and open it again. Now the New Patient field has blank value, as expected. In other words, the Form has shown the correct (blank) value in the dropdown only after the Form was re-opened.
Why the Form did not show blank value in the field the first time; why it shows the blank value only after it was re-opened? Should I call some Reset() or anything like this somewhere?
I can add that I see the same behavior in the both situation when the App is run: when I do Preview or when I do Play (of a published version).