Last modified: Mar 6, 2025

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.

  1. Heading - Main title.
  2. Help text - Click for help pop-up.
  3. Show description - You can describe it.
  4. Personnumber input - Input field for NIN.
  5. Surname - Input field for surname.
  6. Fetch - Button which fetches data based on the inputs.

Behavior

Before a user interacts with the component, it simply displays the input fields.

alt text

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.

alt text

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.

alt text

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.

alt text

When the number of allowed unique failed lookups is exceeded, the components reflects this.

alt text

Properties

The following is an autogenerated list of the properties available for PersonLookup based on the component’s JSON schema file (linked below).

We are currently updating how we implement components, and the list of properties may not be entirely accurate.
PropertyTypeDescription
idstringThe component ID. Must be unique within all setups/pages in a configuration set. Cannot end with .
typestring“PersonLookup”
dataModelBindings.person_lookup_ssnstringWhere in the data model the result (SSN) should be stored.
dataModelBindings.person_lookup_namestringWhere in the data model the result (name) should be stored.
textResourceBindings.titlestringPrompt text (optional)
textResourceBindings.descriptionstringDescription (optional)
textResourceBindings.helpstringHelp text (optional)

Configuration

We are currently updating Altinn Studio Designer with more configuration options! The documentation is continuously updated, and there may be more settings available than what is described here, and some settings may be in beta version.

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
              },
            }
          ]
        }
      }
    }
    
    There is currently no support for the PersonLookup component in Altinn Studio Designer.