☁️ Loving our new documentation website? Provide feedback in the CloudCannon Community! ✨

remove_empty_inputs

Table of contents

Description:

This key toggles whether CloudCannon will remove empty nested inputs from an Object Input or Array Input using a given Structure before persisting them to your file.

Setting this key to true will remove empty nested inputs from an Object Input or Array Input using a given Structure before persisting them to your file. CloudCannon considers an input to be empty when its value is null, ' ', or undefined. If this key is true, empty inputs will be visible in the Data Editor but not the Source Editor. For this key to function, you must also configure id_key for the Structure, as removing inputs prevents CloudCannon from comparing Structure values.

By default, this key is false (i.e., CloudCannon does not remove empty inputs).

You can also configure this behavior for specific values of a Structure using structure.values.[*].remove_empty_inputs.

Appears in:
└── Structure
    └── remove_empty_inputs
Type:
boolean
Default value:
false
Examples:

In this example, we want to delete any unnecessary nested inputs (i.e., input we choose not to provide a value for) from Object or Array inputs referenceing the event_details Structure.

Copied to clipboard
_structures:
  event_details:
    remove_empty_inputs: true
    values:
      - value: 
        name: 
        description: 
        url: 
        time: 
        place: 
        sponsor:
{
  "_structures": {
    "event_details": {
      "remove_empty_inputs": true,
      "values": [
        {
          "value": null,
          "name": null,
          "description": null,
          "url": null,
          "time": null,
          "place": null,
          "sponsor": null
        }
      ]
    }
  }
}
Open in a new tab