Forum Discussion

JustinM89's avatar
JustinM89
Contributor
9 years ago

Null values in JSON passed as { }

I have a JSON request I am sending, and it contains many keys with a null value. Somehow, during the transfer of this JSON to my request (or when it is sent), any null values are all magically switch...
  • JustinM89's avatar
    JustinM89
    9 years ago

    We actually managed to make it work, but we're not sure why it works this way and why it doesn't work the other way.

     

    My transfer step actually has 3 transfers, in this order:

    1. requestJSON - The entire JSON request body (the one with all the nulls)
    2. reportId- Set to a specific node in requestJSON
    3. invoiceType - Also set to a specific node in requestJSON

    Executing the request like this, all of the null values get switched to { }. However, when we move requestJSON to the bottom of the transfers (so the last one to get transferred), it keeps the nulls. For some reason the order of these property transfers affects the JSON. Is this a bug?

     

    To get around this, we just used a Groovy script to inject the reportId and invoiceType directly into requestJSON, so we only need to transfer requestJSON instead of all 3.