Skip to content

Pre-filling using URL parameters #464

Description

@latin-panda

Description

Support pre-filling form fields using URL parameters with XPath syntax, such as &d[/data/uuid]=foo, to match the functionality already available in Enketo. This feature would allow seamless pre-population of form fields (e.g., a text field named uuid) via URL query parameters.

For now, we will match the Enketo API:

  • a d dictionary query parameter using bracket notation (e.g. d[/data/foo])
  • each dictionary key is the full XPath path to the question to populate
  • only element paths in the primary instance can be set this way

Defaults should replace any literal values in the primary instance and be set before any calculation, preload or setvalue actions are triggered. The odk-instance-first-load event should fire after.

Defaults should be ignored when an existing submission is loaded.

Form:

pre-fill using url parameter.xlsx


Checklist

  • Does it need UI/UX design?
    • Yes. Describe the UI/UX requirements or attach a Figma link in the "Design" section.
    • No
  • Does it need API design?
    • Yes. Specify the endpoints, methods, or data structures needed.
    • No
  • Does it need design around state flow?
    • Yes. Outline the state flow requirements.
    • No
  • Does it need a test plan?
    • Yes. Add the test plan as a comment in this task or attach the document.
    • No

User Stories

As a project manager I want to distribute a link to a form that autofills specific fields so that the user doesn't need to re-enter known information.


Design

  • Figma: [Insert URL]
  • Design Docs: [Insert URL]

Dependencies


Additional Notes


Related Issues

Metadata

Metadata

Assignees

Type

No type

Projects

Status
Done

Relationships

None yet

Development

No branches or pull requests

Issue actions