Create JSON action Is Replacing emptystring with null

Hi all. I’m getting some unexpected behavior where a create JSON step is intaking an emptystring but the json outputted has null instead of “”

Here’s my array aggregator where roster_name and roster_number are set to emptystring if the inbound fields are empty.

That array aggregator feeds into a Create JSON step

Here’s what the JSON output looks like when roster_name and roster_number are emptystring - as you see - it writes null when I want it to just write “” (emptystring)

Screenshot 2024-08-21 at 6.30.12 AM

FWIW, here’s how roster_name and roster_number are configured within the JSON data structure:

Your app ought to accept null.
If it doesn’t, you can try passing {{space}} instead which would result in “roster_name”:" "

Trust me, I’m with you. This is being sent to a partner’s API who insists it needs to be an empty string instead of null. :roll_eyes:

Instead of Create JSON, use Aggregate to JSON or a Text Aggregator.

Hope this helps! Let me know if there are any further questions or issues.

@samliew


P.S.: Did you know, the concepts of about 70% of questions asked on this forum are already covered in the Make Academy. Investing some effort into it will save you lots of time and frustration using Make later!

1 Like