Altinn / Altinn/app-frontend-react
Auto-fill fields in new rows using values from other variables in the data model
- Dominant language
- TypeScript
- Stars
- 21
- Forks
- 33
- Avg merge
- 6d 23h
- Merged PRs (30d)
- 3
Description
### Description
I want to be able to have a repeating table in a datamodel that can be split over several pages in an app without writing custom code for adding a new row. The same field in the repeating table should be able to use a different codelist (f.ex. DropDown) on each page.
This problem arises f.ex. when you have such a long codelist, that you want to split it into logical parts, so the DropDown on each page is shorter and more user-friendly. The field in the repeating table represents the same type of content, so it should be possible to use just one datafield (even though the field is shown on several pages).
This is not possible "out-of-the-box" because you cannot use different codelists on the same field when you are filtering on the values from the dropdown. It is necessary to filter on a separate field that is not directly connected to the value from the codelist.
As a work-around I have to create a field in the datamodel that can tell me which page the row was added on or to have several fields in the datamodel even though the content of the field is logically the same. If I want a value to know which page I am on I need to create my own customButton (hiding the standard "Add new row"-button).
If we had an option for the repeating-group to put f.ex. the "name of the page" ("Name XX") into a specified datafield ("YY") in the repeating part of the data model. Then it would be easy to filter on pagename to show the correct rows on the correct page. This would also fix the problem of potentially showing empty lines on all pages when you press the "Add new row"- button.
### Additional Information
See this Slack discussion for context: https://altinn.slack.com/archives/C02EJ9HKQA3/p1741860432521669
Contributor guide
Research direction
Start by tracing the repeating-group “Add new row” behavior and how codelist filtering works when the same field appears on multiple pages. Clarify how a page name should be stored in the repeating data model, including behavior for empty rows, and define completion against the described multi-page use case.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- react, typescript
- Domain
- frontend
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100