getodk / getodk/web-forms

Calculations and actions on upload nodes are not supported

Open
#858 0 comments 0 reactions 1 assignee Claimed by @latin-panda View on GitHub
Dominant language
TypeScript
Stars
38
Forks
22
PR merge metrics
No merged PRs in 30d

Description

### Expected Behaviour

Using setvalue to update an upload control should work. While it doesn't make sense to compute a binary file, if you compute a valid `jr:` url then the resource should be loaded. This also applies to calculate on the `bind` element.

This can be useful particularly for annotating one of a set of images.

### Observed Behaviour

Both setvalue and calculate silently no-op.

### Reproduction Steps

Form (XML or XLSX file): Form and attachments on the forum: https://forum.getodk.org/t/collect-2026-3-0-default-image-inline-preview-missing-take-choose-disabled-crash-on-null-annotation/58380/4

Steps:
1. Load the form
2. Select a radio button in the first field
3. You should see the image load on the annotate field below

For the calculate version, the simplest form has a bind something like this...

```xml

```

### Additional Context

Nodes like InputControl extend ValueNode, but UploadControl does not. This means that `createInstanceValueState` is never called so calculates are never registered. Once the calculate is registered we'll need a way to set the _string_ value of the UploadControl, and then that can be used for the setvalue actions too.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.