Module 6

Expansion of form with repeating group

In this module you will expand the application you have built in the previous modules to support more of the functionality that the municipality of Sogndal wishes to implement.

Topics covered in this module

  • Repeating groups
  • Validation
  • Data processing

Tasks

Requirements from the municipality

To be able to tailor the best possible offers to newcomers we wish to obtain an overview of former residences of the newcomer.

On the data page there should be an option to enter previous residences. Previous residences should contain the following fields:

  • Street address
  • Postal code
  • Postal city

It should be possible to enter up to 10 former residences.

Useful documentation

Knowledge check

  • What field in the data model decides if an element is repeating?
  • How many repetitions are allowed for the field TidligereBosteder?

Requirements from the municipality

Due to a personal vendetta among one of the employees in the municipality of Sogndal, a user who enters the postal code 4619 as a previous residence should NOT be allowed to move to Sogndal. In this case, an error message should appear at the field in question with the following text:

Du er ikke velkommen til vår kommune. Beklager!

Useful documentation

Knowledge check

  • When are validations server-side running?
  • Why should validations added on the client side also be duplicated server-side?

Requirements from the municipality

One of the data processors of Sogndal is sick of manually correcting a street address that often is being incorrectly entered by newcomers. Therefore, we wish to programmatic correct this while the user is filling out the app.

If the user enters Sesame Street 1 in the field Innflytter.Adresse.Gateadresse, this should automatically be corrected to Sesamsgate 1. In all other cases, the field should remain the same.

Useful documentation

Knowledge check

  • When is data processing running?
  • What seperates ProcessDataWrite and ProcessDataRead?
  • What is the difference between DataProcessing and Calculations?

Summary

In this module you have had a look at repeating groups and how this is configured as a part of the user interface. We have also had a look at how to set up custom validations in the backend for cases that will not be defined as a part of restrictions in the data model. Lastly, we have looked at how to set up data processing that enables manipulation of data runtime.

Solution

If you did not manage to complete all the steps, we have an example of a solution that you can use as inspiration.

Screenshot of data collecting page with repeating groups

Screenshot of data collecting page with repeating groups