What is your goal?
I’m building a private Custom App that integrates with our company’s REST API, and I need to send optional nested objects in POST request bodies only when the calling user actually provides them. When those optional fields are left blank, the request must omit the nested object entirely rather than sending it as an empty object. Thanks
What is the problem & what have you tried?
When an optional collection parameter is left empty, Make serializes it into the request body as an empty object {}, which my API rejects with a validation error because it expects the key to be absent entirely. I attempted to handle this in the Communication block using if() expressions and undefined, but I could not get Make to drop the empty nested object. The Make.com documentation recommended fix is the removeEmpty() custom IML function, which requires custom IML functions to be enabled on my account.
Error messages or input/output bundles
The API I am calling returns a 400 when the optional parameter is blank.
