Feature update: Choose whether to return null values on your flow fields


#1

Hello all! We’d like to introduce you to a small but significant improvement in the optimisation of API response sizes: the ability to choose whether flow fields with a null value should be returned by the API when the entity containing those fields is requested.

For example, say you created a products flow, so you could append additional fields to the standard moltin product model. You would then create your new field that you want to see on a product.

As you’ll see from the documentation, a field now has something called “omit_null” which can be set to either true or false. You’ll pass this in when creating the field. Let’s say you set it to true. Bear in mind that omit_null will override the default value you set.

Now, when you create a new product and fetch it, because the value of your flow field is null, you will not see this field returned on the product. Should you update the field to have a value, it will now be returned.