Skip to content

Get personal information (Sweden)

Click here to show the snippet.

{"fields":[{"fieldsViewModel":{"fields":[{"fieldsViewModel":{"fields":[]},"name":"SSN","displayName":{"en-US":"Social security number"},"description":{"en-US":""},"type":"InputText","size":"3","properties":{"defaultvalue":{"en-US":""},"validationmessage":{"en-US":"Format YYYYMMDD-XXXX"},"validationtype":5,"validationpattern":"^(19|20)?(\\d{6}([-+]|\\s)\\d{4}|(?!19|20)\\d{10})$"},"required":false,"readonly":false,"hidden":false,"lineBreak":false,"isBound":false,"onLoad":"","onChange":"if (/^(19|20)?(\\d{6}([-+]|\\s)\\d{4}|(?!19|20)\\d{10})$/.test(Z('#SSN').val())) {\n    if (!Z('#SSN').val().startsWith('19') && !Z('#SSN').val().startsWith('20')) {\n        var ssn = \"19\" + Z('#SSN').val();\n        Z('#SSN').val(ssn);\n    } else {\n        var ssn = Z('#SSN').val();\n    }\n    \n    Z('#SSN').spin(true, 'Loading personal information..');\n    Z('#FirstName').clear();\n    Z('#GivenName').clear();\n    Z('#LastName').clear();\n    Z('#Street').clear();\n    Z('#City').clear();\n    Z('#Zip').clear();\n    \n    Z.call('Get-ZPPLSEPersonInformation', { SSN: ssn }).done(function(data) {\n        if (data[0]) {\n            Z('#ErrorMessage').clear();\n            Z('#FirstName').val(data[0].FirstName);\n            Z('#GivenName').val(data[0].GivenName);\n            Z('#LastName').val(data[0].LastName);\n            Z('#Street').val(data[0].AddressStreet);\n            Z('#City').val(data[0].AddressCity);\n            Z('#Zip').val(data[0].AddressZip);\n        } else {\n            Z('#ErrorMessage').val('<font color=\"red\">Person not found.</font>');\n        }\n    }).always(function(){\n        Z('#SSN').spin(false, '');\n    })\n}","onSubmit":"","boundTo":""},{"fieldsViewModel":{"fields":[]},"name":"ErrorMessage","displayName":{"en-US":"ErrorMessage"},"description":{"en-US":""},"type":"TextBlockRTF","properties":{"text":{"en-US":""}},"required":false,"readonly":false,"hidden":false,"lineBreak":false,"isBound":false,"onLoad":"","onChange":"","onSubmit":"","boundTo":""},{"fieldsViewModel":{"fields":[]},"name":"FirstName","displayName":{"en-US":"First name"},"description":{"en-US":""},"type":"InputText","size":"3","properties":{"defaultvalue":{"en-US":""},"validationmessage":{"en-US":""},"validationtype":0,"validationpattern":""},"required":false,"readonly":false,"hidden":false,"lineBreak":false,"isBound":true,"onLoad":"","onChange":"","onSubmit":"","boundTo":"FirstName"},{"fieldsViewModel":{"fields":[]},"name":"GivenName","displayName":{"en-US":"Given name"},"description":{"en-US":""},"type":"InputText","size":"3","properties":{"defaultvalue":{"en-US":""},"validationmessage":{"en-US":""},"validationtype":0,"validationpattern":""},"required":false,"readonly":false,"hidden":false,"lineBreak":false,"isBound":true,"onLoad":"","onChange":"","onSubmit":"","boundTo":"GivenName"},{"fieldsViewModel":{"fields":[]},"name":"LastName","displayName":{"en-US":"Last name"},"description":{"en-US":""},"type":"InputText","size":"3","properties":{"defaultvalue":{"en-US":""},"validationmessage":{"en-US":""},"validationtype":0,"validationpattern":""},"required":false,"readonly":false,"hidden":false,"lineBreak":false,"isBound":true,"onLoad":"","onChange":"","onSubmit":"","boundTo":"LastName"},{"fieldsViewModel":{"fields":[]},"name":"Street","displayName":{"en-US":"Street"},"description":{"en-US":""},"type":"InputText","size":"4","properties":{"defaultvalue":{"en-US":""},"validationmessage":{"en-US":""},"validationtype":0,"validationpattern":""},"required":false,"readonly":false,"hidden":false,"lineBreak":false,"isBound":true,"onLoad":"","onChange":"","onSubmit":"","boundTo":"Street"},{"fieldsViewModel":{"fields":[]},"name":"City","displayName":{"en-US":"City"},"description":{"en-US":""},"type":"InputText","size":"3","properties":{"defaultvalue":{"en-US":""},"validationmessage":{"en-US":""},"validationtype":0,"validationpattern":""},"required":false,"readonly":false,"hidden":false,"lineBreak":false,"isBound":true,"onLoad":"","onChange":"","onSubmit":"","boundTo":"City"},{"fieldsViewModel":{"fields":[]},"name":"Zip","displayName":{"en-US":"Zip"},"description":{"en-US":""},"type":"InputText","size":"3","properties":{"defaultvalue":{"en-US":""},"validationmessage":{"en-US":""},"validationtype":0,"validationpattern":""},"required":false,"readonly":false,"hidden":false,"lineBreak":false,"isBound":true,"onLoad":"","onChange":"","onSubmit":"","boundTo":"Zip"}]},"name":"FormSection","displayName":{"en-US":"Person lookup"},"description":{"en-US":""},"type":"FormSection","properties":{"direction":0,"chrome":true,"fullwidth":true},"required":false,"readonly":false,"hidden":false,"lineBreak":false,"isBound":false,"onLoad":"","onChange":"","onSubmit":"","boundTo":""}],"variables":[{"realId":58,"name":"City","value":"","shouldHide":false,"hideStartIndexDisplay":1,"hideLengthDisplay":1,"hideAll":false,"hideRemaining":false,"hideLength":1,"hideStartIndex":1,"isInputParameter":false,"isOutputParameter":false,"isRequired":false,"displayName":"City","description":"","variableUsageList":[],"id":58,"variableType":"String","isSystemVariable":false,"isAssignable":true,"isBound":true,"isBoundToSetupFormField":false},{"realId":60,"name":"FirstName","value":"","shouldHide":false,"hideStartIndexDisplay":1,"hideLengthDisplay":1,"hideAll":false,"hideRemaining":false,"hideLength":1,"hideStartIndex":1,"isInputParameter":false,"isOutputParameter":false,"isRequired":false,"displayName":"FirstName","description":"","variableUsageList":[],"id":60,"variableType":"String","isSystemVariable":false,"isAssignable":true,"isBound":true,"isBoundToSetupFormField":false},{"realId":55,"name":"GivenName","value":"","shouldHide":false,"hideStartIndexDisplay":1,"hideLengthDisplay":1,"hideAll":false,"hideRemaining":false,"hideLength":1,"hideStartIndex":1,"isInputParameter":false,"isOutputParameter":false,"isRequired":false,"displayName":"GivenName","description":"","variableUsageList":[],"id":55,"variableType":"String","isSystemVariable":false,"isAssignable":true,"isBound":true,"isBoundToSetupFormField":false},{"realId":56,"name":"LastName","value":"","shouldHide":false,"hideStartIndexDisplay":1,"hideLengthDisplay":1,"hideAll":false,"hideRemaining":false,"hideLength":1,"hideStartIndex":1,"isInputParameter":false,"isOutputParameter":false,"isRequired":false,"displayName":"LastName","description":"","variableUsageList":[],"id":56,"variableType":"String","isSystemVariable":false,"isAssignable":true,"isBound":true,"isBoundToSetupFormField":false},{"realId":57,"name":"Street","value":"","shouldHide":false,"hideStartIndexDisplay":1,"hideLengthDisplay":1,"hideAll":false,"hideRemaining":false,"hideLength":1,"hideStartIndex":1,"isInputParameter":false,"isOutputParameter":false,"isRequired":false,"displayName":"Street","description":"","variableUsageList":[],"id":57,"variableType":"String","isSystemVariable":false,"isAssignable":true,"isBound":true,"isBoundToSetupFormField":false},{"realId":59,"name":"Zip","value":"","shouldHide":false,"hideStartIndexDisplay":1,"hideLengthDisplay":1,"hideAll":false,"hideRemaining":false,"hideLength":1,"hideStartIndex":1,"isInputParameter":false,"isOutputParameter":false,"isRequired":false,"displayName":"Zip","description":"","variableUsageList":[],"id":59,"variableType":"String","isSystemVariable":false,"isAssignable":true,"isBound":true,"isBoundToSetupFormField":false}]}

Description

This snippet adds a form section where the user can enter a Swedish social security number and the webservice will retrieve the user's personal information and fill the form.

What you get

Features

  • Retreives person information
  • Fills form
  • Validates social security number
  • Loading indicator (spinner)

Prerequisites

  • Person Lookup SWE Plugin

Zervicepoint version

  • Built in Zervicepoint version: 1.25

Configuration needed

  • No immediate configuration needed.

How do I use a snippet?

It's very easy! Check out the following instructions:

What are snippets?