Best answer

{{bundle.inputData.field}} is sent even when empty

  • 23 March 2022
  • 3 replies
  • 324 views

I have created a integration that requires a API POST call.

Everything goes smooth but when certain fields are empty the value {{bundle.inputData.field}} is printed in the DB.

It does not seem to happen for all fields, though - and that’s confusing.

icon

Best answer by fratimo66 23 March 2022, 17:40

View original

This post has been closed for comments. Please create a new post if you need help or have a question about this topic.

3 replies

Userlevel 7
Badge +9

Would you mind posting your code? Maybe some more eyes can help spot the issue.  

Note that, when configuring requests in “Form Mode” in the Platform UI there’s an option to omit empty values automatically: 

(If you’re working in Code Mode that’s not helpful, but posting here for other readers)

Before turning that on: here is the body of the message {"id":"55322","cars":"","pets":"","city":""}

After turning on those options: here is the body of the message {"id":"55322"}

Note that the empty values are null… not the variable name with curlies, which makes me think something is misconfigured.  

Hi Zane, thanks for having the time to look into it. I’m working in Code Mode.

 

I’ve sorted this by turning the

“field” : “{{bundle.inputData.field}}”

into

“field” : bundle.inputData.field

 

Userlevel 7
Badge +9

Awesome! Glad you’re up and running. And thanks for posting the follow up. 😀