Skip to content

Shortcut syntax to access Entity id #816

@lognaturel

Description

@lognaturel

Each row on an XLSForm's entities sheet represents a declaration to take some action on an Entity List (create, update, etc). It can sometimes be useful to reference a specific Entity's id in the form definition. In the case of an update declaration, that's easy because the id is saved in a form field. But in the case of a create declaration, the id only exists as an attribute value.

This issue is for introducing shortcut syntax that pyxform would convert to an XPath path reference to an Entity's ID or error if the reference is ambiguous.

When we added last-saved#, we discussed using a similar syntax for accessing Entity properties.

My current proposal is to use the Entity list name as the prefix because we are requiring each row on the entities sheet to have a unique target list. For example, if the entities sheet has Entity declarations that target the households and participants lists, households#__id and participants#__id would be valid anywhere in the form that this unambiguously identifies a single identity and would expand to the appropriate XPath path.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions