Select to view content in your preferred language

Catch blank/empty cells in attribute table (not <Null>)

1058
2
Jump to solution
10-18-2019 08:01 AM
MKF62
by
Frequent Contributor

I have blank cells in an attribute table I'd like to catch using python. These cells are not filled with <Null> but are simply blank. Will this statement catch all possibilities in a blank cell? The blank cells could only occur in string fields and would be produced using Collector Classic on an iPhone since, for some reason, it doesn't enforce required fields like an Android phone does and instead just fills required text fields with an empty value.

if x == [None, '', ' ']:
    #do something

I think None actually catches <Null> but can't hurt to have it there I guess.

0 Kudos
1 Solution

Accepted Solutions
DanPatterson_Retired
MVP Emeritus

IN

None in [None, '', ' ']
True

'' in [None, '', ' ']
True

' ' in [None, '', ' ']
True

' ' in [None, '', 'b ']
False

' ' in [None, '', ' b']
False

View solution in original post

2 Replies
DanPatterson_Retired
MVP Emeritus

IN

None in [None, '', ' ']
True

'' in [None, '', ' ']
True

' ' in [None, '', ' ']
True

' ' in [None, '', 'b ']
False

' ' in [None, '', ' b']
False
DanPatterson_Retired
MVP Emeritus

BTW  <null> isn't a real thing it is a visual artifact used to represent None which is a real thing but isn't reflected by its textual representation... it is nothing and there is only one None