I’m building a workflow where it is an important difference in my data table if the value of a string is the empty string (“”) or Nothing (Null). First I use the Build Data Table activity where I explicitly checked Allow Null for some string column. Then I use several Add Data Row activities to add my data rows giving the input by using ArrayRow. For example, I would put in something like {“Hello world”, 777, Nothing} as array row if I want the third value (string value) of a 3-value-row to be Nothing. Later in my workflow I want to check with an If activity, if the third value of a certain row is Nothing. I use the condition CurrentRow(2) is Nothing. But even for rows where I put in the Nothing value the condition is evaluated to False. On the other hand, if I check on the empty string with CurrentRow(2).Equals(“”) I also get a False, so it is neither Nothing nor the empty string.
How do I manage to get Nothing into some cell of my data table and be able to check on Nothing with the is Nothing expression?
isNothing(row(2)) does not work unfortunately. String.IsNullorEmpty(row(2).toString().Trim()) throws out True, but it is also evaluated to True if row(2) is the empty string. Furthermore, row(2).toString().Trim() is in fact evaluated to the empty string, if row(2) is Nothing.
we prepared a datatable:
And add 2 additional rows:
for test case 4 we do see it is not nothin
it will not break, when using is toString() - a null value would do
it let evaluate String.IsNullOrEmpty to true
you have just delivered me the solution in your last picture. IsDBNull(…) is the method that I was looking for. With that method I can test a string, getting True if it is Nothing and False if it is anything else. The Is Nothing method seems not to be working on values from data tables.