Conditional Exclusion of Fields from Document of Record (Code vs UI Checkbox) Does Not Work | Community
Skip to main content
Level 1
May 29, 2026

Conditional Exclusion of Fields from Document of Record (Code vs UI Checkbox) Does Not Work

  • May 29, 2026
  • 1 reply
  • 77 views

Hi all,

I need to conditionally exclude some fields from the auto-generated DOR through code. Nothing I’ve tried to program is working.

Please, how can I emulate in code what the “Exclude From Document Of Record” checkbox does? It works correctly when I use the UI checkbox, but if I try to do it via code in the Value Commit event, it doesn’t work. I’ve tried things like:

field.dorExclude = true; field.excludeFromDoR = true; field.dorExclude = true

…but none of it works.

 

Thanks in advance for your help!
Any guidance would be greatly appreciated.

1 reply

Adobe Employee
June 2, 2026

Hi ​@Pilar_mrt,

Thanks for reaching out.

The supported runtime property for this behavior is excludeFromDoR. If you want to reproduce in script what the “Exclude From Document of Record” checkbox does in the UI, use that property in your rule or event script.

For example:

this.excludeFromDoR = true;

Or, if you are targeting another field:

TargetField.excludeFromDoR = true;

A few important notes:

  • dorExclude is not the correct runtime property.
  • If you are testing this behavior, please validate it using an actual form submission and inspect the generated DoR, rather than relying only on preview.
  • If your scenario depends on fields being hidden dynamically, also make sure the form-level DoR settings are configured appropriately, especially Exclude hidden fields from Document of Record and, where applicable, server revalidation.

So in short, to emulate the checkbox through code, please use excludeFromDoR.

If you’d like, share the exact script you are using in the Value Commit event and we can help adjust it for your specific field names and condition.

https://experienceleague.adobe.com/en/docs/experience-manager-65/content/forms/adaptive-forms-advanced-authoring/generate-document-of-record-for-non-xfa-based-adaptive-forms#document-of-record-settings
 

Thanks
Pranay

Pilar_mrtAuthor
Level 1
June 4, 2026

Hi Pranay,!--scriptorstartfragment-->

Thanks again for your previous explanation, it helped me understand better how `excludeFromDoR` should work.

I’m still having an issue in a specific scenario and I’d like to confirm if I’m missing something.

My setup is the following (auto-generated DoR using JSON schema, no XDP template):

- I have a checkbox: “Sede del Banco de España en Madrid” (SedeBDE)

- I have a panel: “SesionSucursal”, which contains:

  - Sucursal

  - Número de personas asistentes

What I want is:

When the checkbox is selected, the whole “SesionSucursal” panel should:

1. Be hidden in the UI ✅ (this works correctly)

2. Be excluded from the DoR ❌ (this is where it fails)

Important configuration:

- “Exclude hidden fields from Document of Record” is enabled at form level

- If I manually check “Exclude From Document Of Record” in the panel properties, it works correctly

- So the DoR configuration itself seems fine

What I tried:

1. Initially, I applied the logic at field level (Sucursal, NumAsistente), but the fields were still appearing in the DoR.

2. Then I switched to panel level (SesionSucursal), using Value Commit on the checkbox:

```javascript

SesionSucursal.visible = false;

SesionSucursal.excludeFromDoR = true;

!--scriptorendfragment-->

I also tried using:

SesionSucursal.dorExclusion = true!--scriptorendfragment-->!--scriptorstartfragment-->

(as suggested by the autocomplete), but that didn’t work either.

Current behavior:

  • The panel is correctly hidden in the UI
  • But it still appears in the generated DoR

So my questions are:

  1. Is Value Commit a reliable event to control excludeFromDoR, or can the form model be re-evaluated afterwards and override this property?

  2. When “Exclude hidden fields from DoR” is enabled, should setting visible = false on a panel be enough to exclude it, or are there cases where the model still treats it as visible?

  3. Is there a recommended event or pattern in Adaptive Forms to ensure that excludeFromDoR is applied at the right moment (e.g. Change event, rule editor, pre-submit, etc.)?

From my tests, it looks like the property is either not being persisted in the final model or is being overridden before DoR generation, but I’d like to confirm if this is expected behavior.

Thanks a lot for your help!

DOR:

 

Adobe Employee
June 5, 2026

Hi ​@Pilar_mrt,
 

Thank you for the detailed reproduction steps — they were very helpful.

Based on the scenario you described, Value Commit itself is not inherently the problem. For a submission-generated auto DoR, the expected behavior is that if:

  • the panel is hidden at runtime, and
  • Exclude hidden fields from Document of Record is enabled at the form level,

then the hidden panel should be omitted from the final DoR generated on submission.

A few important clarifications:

  • The excludeFromDoR / dorExclusion behavior is a runtime/submission-time behavior, so DoR preview is not a reliable validation method for this specific case.
  • For a checkbox-driven scenario such as yours, using a rule or script to hide the panel should normally be sufficient, and the hidden-panel exclusion should then be applied during submission-time DoR generation.
  • In other words, for this use case, setting visible = false on the panel should generally be enough, provided the submission path is honoring the hidden-field exclusion metadata correctly.

From what you described, this no longer looks like a simple scripting mistake. It looks more like one of these two cases:

  1. A product issue / known limitation in the form runtime used by your form, where hidden fields or panels are not being excluded from the DoR even though the configuration is correct.
  2. A submission-path-specific limitation, where the submit action used by the form does not fully honor runtime DoR exclusion metadata.

To narrow this down, could you please confirm these two points?

  1. Is the form built with Foundation Components or Core Components?
  2. What Submit Action is configured on the form?
    For example: Email, Forms Portal Submit Action, AEM Workflow, SharePoint, etc.

As a best-practice pattern, we would recommend keeping the logic data-driven from the checkbox itself and relying on:

  • the panel hide/show rule, and
  • the form-level Exclude hidden fields from Document of Record option

rather than depending on multiple manual DoR property updates in script.

If you share the component model and the submit action, we can confirm whether this is expected behavior for that path or whether it matches a known product issue.

Thanks