I have a Canvas app with a Form. The Form contains a Data Card with a Text Input component inside. The Data Card is bound to an SQL table MyTable, column MyColumn [nvarchar](255) NULL.
Let’s imagine that an end-user modifies the Text Input component; and the component becomes empty in the end; then saves the Form.
What would be put into MyTable.MyColumn: NULL or an empty string? Is there any way to manage this behavior?
Solved! Go to Solution.
You will get an empty string.
You can control it by intercepting in the Update property of your datacard.
i.e.
If(IsBlank(yourTextInput.Text), Blank(), yourTextInput.Text)
Note: you will need to make sure you have the Formula level error management feature turned on in your app.
Also, sometimes the null will be in the TextInput and get interpreted as "" instead of Blank. So the following change to the above will resolve that:
If(IsBlank(Trim(yourTextInput.Text)), Blank(), yourTextInput.Text)
The introduction of the Trim function will ensure a proper value to the IsBlank.
I hope this is helpful for you.
You will get an empty string.
You can control it by intercepting in the Update property of your datacard.
i.e.
If(IsBlank(yourTextInput.Text), Blank(), yourTextInput.Text)
Note: you will need to make sure you have the Formula level error management feature turned on in your app.
Also, sometimes the null will be in the TextInput and get interpreted as "" instead of Blank. So the following change to the above will resolve that:
If(IsBlank(Trim(yourTextInput.Text)), Blank(), yourTextInput.Text)
The introduction of the Trim function will ensure a proper value to the IsBlank.
I hope this is helpful for you.