Kamal Kant
Kamal Kant

Reputation: 1148

Is there a way in mapbox expression to check if attribute values are empty or blank space?

I am trying to check if the field values are null or empty(blank space). Is there a way to trim the field values and check if those are empty string or not?

['==', ['get', 'fieldName'], null] like similar to this ['==', ['trim', ['get', 'fieldName']], '']

Upvotes: -1

Views: 20

Answers (1)

Andrew-Sepic
Andrew-Sepic

Reputation: 563

I believe you'll want to use to-boolean. And you should be able to do something like this..

["!", ["to-boolean", ["get", "fieldName"]]]

Upvotes: 1

Related Questions