I have an SQL table with a column that looks like this:
MyColumn [nvarchar](2000) NULL
I have created a simple Canvas app wit a Gallery whose data source is the SQL table. In the Gallery I have a Text input component attached to MyColumn column. When an end-user enters blank string (or clears the component, as we could call it) in the component and then the component is saved into DB ,I see that a blank string was put into the DB column MyColumn.
I do not want the blank string in the DB in this situation; I want NULL. I have tried to resolve the problem this way: in OnChange property of the |Text input control I wrote this:
Patch('MyTable',ThisItem,
{MyColumn:If(IsBlank(t_TextInputComponent.Text), Blank(), t_TextInputComponent.Text)l})
But this has not worked: a blank string was put into the DB column anyway.
How can I solve the problem?

Report
All responses (
Answers (