You want to return a null or int, but you are wrapping everything in double quotes, which makes it a string containing "null" or "0" – which is clearly not null or 0
I’m still struggling with this. I was having issues with JSON including spaces. So the way I know I can get this to work is by changing the body to be of type Text.
The way I see it working to get past the null/int is by only sending data if it exists.
So do an if check on the value, then insert the whole json string.
Thanks for the help and apologies for the back and forth but implementing your method still isn’t giving me the desired results. I’m wondering if it’s to do with the fact I have the Type set as ‘Text’. When I had the Type set as JSON I was getting a failed JSON error, and I think that was because I wasn’t updating every field in the payload, only specific ones like Closed File Box, for example.
When I enter the following code, for the purpose of testing the length…
I think thats becuase the map function is putting the value into an array which is why it always displays as 1?
I’m guessing I would need to do something like:
“Closed File Review Date Length”: {{length(map(2.custom_field_values; “value”; “field_name”; “Closed File Review Date”) + “[0].Value”)}}
?
EDIT: I was able to fix this by putting a get in there.
{{get(map(2.custom_field_values; “value”; “field_name”; “Closed File Destruction Date”); 1)}}
Thanks a lot for keeping us in the loop and for sharing your final setup with the rest of the community. This is super valuable and could be incredibly helpful to many others looking for similar information.