RE: SuiteQL Response Excluding Null Fields
Hello All,
I’m researching the best way to extract data from NetSuite for our Data Warehouse. I have come across the Rest Web Services, however, a large number of the objects we need are listed under Beta, but it appears those are fully available via the query service.
With that being said, when submitting a simple “select * from” query to the API I get a response which appears to exclude any of the fields that are null. I’d like all columns from said object to return.
Am I missing something simple?
Thanks!
The NetSuite Query Service does exclude null fields from the response by default. However, there is a way to include null fields in the response. To do this, you need to set the includeNullFields
parameter to true
in your query.
For example, the following query will return all fields from the customer
object, including null fields:
SELECT * FROM customer WHERE includeNullFields=true
You can also use the includeNullFields
parameter to include null fields in the response for specific fields. For example, the following query will return the name
and email
fields from the customer
object, including null fields:
SELECT name, email FROM customer WHERE includeNullFields=true
The includeNullFields
parameter is supported in all versions of the NetSuite Query Service, including the beta versions.
Here is an example of how to use the includeNullFields
parameter in the REST Web Services:
GET /query/v2/query?q=SELECT%20*%20FROM%20customer%20WHERE%20includeNullFields=true
This request will return all fields from the customer
object, including null fields.
I hope this helps!