Altinn / Altinn/app-frontend-react

Dynamic expressions for options/optionsId

Open
#1,942 1 comment 0 reactions 0 assignees View on GitHub
area/codelists area/logic kind/feature-request
Dominant language
TypeScript
Stars
21
Forks
33
Avg merge
6d 23h
Merged PRs (30d)
3

Description

### Description

Enable the use of dynamic expressions for `options`/`optionsId` on relevant components, even though achievable by using [dynamic code lists](https://docs.altinn.studio/app/development/data/options/dynamic-codelists/), would provide a simpler more straight-forward alternative.

### Additional Information

```
{
"id": "1-0-RadioButtons",
"type": "RadioButtons",
"required": true,
"readOnly": false,
"textResourceBindings": {
"title": "1-0-RadioButtons.title"
},
"dataModelBindings": {
"simpleBinding": "Path.To.Something"
},
"optionsId": [
"if",
[
"equals",
[
"dataModel",
"Path.To.SomethingElse"
],
true
],
"alt1_optionsSet",
"else",
"alt2_optionsSet"
]
}
```

Contributor guide

Open the contributing guide

Research direction

Start by reading the linked dynamic code lists documentation and locating how relevant components currently handle options and optionsId. Compare that behavior with the provided RadioButtons example and define how dynamic expressions should select an options set; the work is done when the supported components accept and evaluate this form consistently.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
frontend
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.