Delete keys with empty values in array

Hi
Using data from an api request where I have order line items that I push in to an Iterate module and then to an aggregate module so I can push the data into the endpoint.
The aggregate module have a ready set up for the fields needed so the keys is correct.
Problem is that it also push keys into the array that has a null value (empty) and the endpoint is not accepting null values (the keys with empty values should not be there at all) .
How do I delete the keys with null value, is that even possible?

Another solution could be to set up the aggregate module as custom, but then the keys are not correct - is it possible to change them somehow?


After your iterator and before your aggregator use a filter that will filter out if any of the keys are empty.

So you need to do VAT Exist AND UNIT Exist AND Price Exists…

Hi
Problem is that the key names (which comes from a http request) are not the correct ones. They get the correct key names first after the aggregator module

So iterate on them again then aggregate again.

3 Likes

Hi, thanks that was the solution. The filters I do not use because that drops the whole collection.

1 Like