Skip to content

Conversation

@lindsay-stevens
Copy link
Contributor

@lindsay-stevens lindsay-stevens commented Jan 7, 2026

Closes #796

Why is this the best possible solution? Were any other approaches considered?

This adds instanceID to the list of allowed element names that can be referenced with ${}. This is a key part of entity use cases mentioned in #796.

Considered not covering the related but undocumented / untested settings instance_id and omit_instanceID, but they impact this feature and may be in use, and could be removed separately.

What are the regression risks?

Fixes a regression. If a question named instanceID exists, that is still allowed, but if a reference to ${instanceID} is added, that will raise an error due to a duplicate name - which is the current release behaviour.

Does this change require updates to documentation? If so, please file an issue here and include the link below.

Yes, filed here.

Before submitting this PR, please make sure you have:

  • included test cases for core behavior and edge cases in tests
  • run python -m unittest and verified all tests pass
  • run ruff format pyxform tests and ruff check pyxform tests to lint code
  • verified that any code or assets from external sources are properly credited in comments

- add tests for related instance_id / instanceID behaviour
  - existing test_create_repeat asserts via xpe.model_instance_meta that
    the entity meta group doesn't contain an instanceID element.
Copy link
Contributor

@lognaturel lognaturel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!

@lognaturel
Copy link
Contributor

Considered not covering the related but undocumented / untested settings instance_id and omit_instanceID, but they impact this feature and may be in use, and could be removed separately.

I either never knew about these or forgot about them. As far as I know, servers will typically reject forms without instanceID and submissions with duplicate instanceID values so they're not particularly useful. It's good to have their behavior documented through tests. 👍

@lognaturel lognaturel merged commit 66b8fd7 into XLSForm:master Jan 7, 2026
14 checks passed
@lindsay-stevens lindsay-stevens deleted the pyxform-796 branch January 8, 2026 04:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

instanceID is no longer recognized as a valid reference in v4.x

2 participants