How to send back-end null instead of empty string for field with no value ?

How to send back-end null instead of empty string for field with no value ?

danygiacodanygiaco Posts: 10Questions: 4Answers: 0

Hello,
When I create a new entry letting some no mandatory fields empty, the fields have the value '' (empty string) in the body of the request sent to back-end.
I would like these fields to have null value instead of empty string.

Current values :
{"data":{"0":{"issue_id":"-1","criticality":"Medium","issue_description":"","status":"Discarded","opened":"","closed":""}},"action":"create"}

Expected values :
{"data":{"0":{"issue_id":"-1","criticality":"Medium","issue_description":null,"status":"Discarded","opened":null,"closed":null}},"action":"create"}

I tried to use :
defaultContent : null for columns
def : null for fields
But the situation remained the same.

Have you got any clue to help me fix this situation?
Thank you !

Answers

  • colincolin Posts: 9,856Questions: 0Answers: 1,635

    Is this sending back traffic caused by Editor updates? Or is something else going on? Please could you give more information, and if possible link to your page.

    Colin

  • danygiacodanygiaco Posts: 10Questions: 4Answers: 0

    It is not related with Editor updates as we always used the same version (the latest one).
    Unfortunately, I cannot share the page with you because of restrictions.

    What is the default behaviour when a field is not filled ? (blank string or null value ?)
    Thanks

  • colincolin Posts: 9,856Questions: 0Answers: 1,635

    Ah no, I meant are you updating the data with Editor? Or are you using your own mechanism?

    Colin

Sign In or Register to comment.