PersonLookup
Search the National Population Register
Usage
The PersonLookup component searches the National Population Register based on user provided input for NIN (National identity number) and surname, and stores the result using a data model binding.
Anatomy
The component consists of a main title, help text, description, NIN-input title, NIN-input, surname-input title, surname-input name and a fetch button.
- Heading - Main title.
- Help text - Click for help pop-up.
- Show description - You can describe it.
- Personnumber input - Input field for NIN.
- Surname - Input field for surname.
- Fetch - Button which fetches data based on the inputs.
Behavior
Before a user interacts with the component, it simply displays the input fields.
On a successful fetch the component adds a description to the fields, indicating that the data displayed is fetched from the National Population Register. The button transforms from a fetch button to a remove button.
The component has built in validation for the input fields on blur and on fetch. The NIN-input field validates the format of the National identity number according to the official guidelines for NINs. The surname input field checks that a surname is provided. The error messages for the input validations are displayed on the PersonLookup component.
Given valid input, but a mismatch between NIN and surname, the component displays an error message after attempting to fetch. There is a limit on the amount of unique failed lookups before the user is temporarily blocked.
When the number of allowed unique failed lookups is exceeded, the components reflects this.
Properties
The following is an autogenerated list of the properties available for PersonLookup based on the component’s JSON schema file (linked below).
Property | Type | Description |
---|---|---|
id | string | The component ID. Must be unique within all setups/pages in a configuration set. Cannot end with |
type | string | “PersonLookup” |
dataModelBindings.person_lookup_ssn | string | Where in the data model the result (SSN) should be stored. |
dataModelBindings.person_lookup_name | string | Where in the data model the result (name) should be stored. |
textResourceBindings.title | string | Prompt text (optional) |
textResourceBindings.description | string | Description (optional) |
textResourceBindings.help | string | Help text (optional) |
Configuration
Example
In the following example, we configure the component to add a board chairman.
We indicate that providing a person is mandatory, and we override the title.
We choose not to use the description or the help text.
The result will be in the data model at Styre.Styreleder
.
Basic component:
App/ui/layouts/{page}.json
{
"$schema": "https://altinncdn.no/toolkits/altinn-app-frontend/4/schemas/json/layout/layout.schema.v1.json",
{
"data": {
"layout": [
{
{
"id": "Styreleder-lookup",
"type": "PersonLookup",
"dataModelBindings": {
"person_lookup_ssn": "Styre.Styreleder.Foedselsnummer",
"person_lookup_name": "Styre.Styreleder.Name"
},
"textResourceBindings": {
"title": "styre-og-revisjon.Group-1.title"
},
"required": true
},
}
]
}
}
}