on ‎2021 Oct 14 9:48 AM
Hi guys,
is it possible to set the 'ignore null values', when sending the API request through the Webhook action in the BR?
Our use case:
We are sending API requests to 3rd party API and it's working fine if we fill all the API attributes with some values.
However if we do not include one of the attributes in the API call, the 3rd party API on the other side receives 'null' value for this attribute, so the stored value is 'nulled'.
1. Here is an example with all the attributes filled:

2. Here is an example with the attribute "status" missing:

Is there any way to avoid this behavior?
Thank you.
Request clarification before answering.
Hi Tomas
If I understand your question correct the following might be helping.
In the body of Webhook you can use some level of javascript.
{
${serviceCall.remarks ? '"remarks": "' + serviceCall.remarks + '", ' : null }
"code": "${serviceCall.code}"
}
This expression is checking if serviceCall.remarks is empty. If it is empty it will print nothing for remarks in the field. If it has some value it will print the remarks and it's key in it.
-> If remarks has NO value it will print: { "code": "359" }
-> If remarks has value it will print: { "remarks": "This has some value", "code": "359" }
Hope this solves your issue.
Best
Sven
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
| User | Count |
|---|---|
| 15 | |
| 5 | |
| 5 | |
| 3 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.