Does jsonforms offer an out of the box way to not include untouched input fields?

I have about 90 fields of which only 3 are required. However, I noticed that when the data is submitted, all of the keys for the fields, including the untouched ones are included, except with null values. Is there a way to have the untouched keys be excluded from the data payload out of the box. I suppose I can call reduce and filter out the keys manually, but thought I’d check to see if there’s a way to not add these keys at all instead of adding unused keys and then manually removing them before sending. Thank you very much!

Hi @fform,

JSON Forms actually does not fill in any values by default. So if a field is not touched, there will also not be a value for it stored, including null.

I can see two different reasons why you might encounter null values:

  • Do you alrady hand in a data object which contains null values for all fields? JSON Forms will not touch these values and therefore they will also be emitted then
  • Did you model default: null in JSON Schema and use JSON Forms with AJV’s useDefault support? In that case the null values will be added, however this can be prevented by just not using the useDefault option of AJV or removing the default: null entries in your JSON Schema