1

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:

enter image description here

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):

enter image description here

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”:

enter image description here

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).

Victor Sotnikov
  • 177
  • 1
  • 2
  • 15

1 Answers1

1

Instead of using Blank() value for dropdown, you can use AllowEmptySelection property of dropdown control.

Set AllowEmptySelection property of dropdown control to true.

Documentation: Dropdown control key-properties

Ganesh Sanap
  • 1,386
  • 1
  • 8
  • 18