Skip to main content

Resident Functions - Portal

A resident function is a script (program code) that allows you to perform some operations on regulated data without its leaving the country of origin, so that you do not violate any local requirements on handling personal data.

You can perform the following operations on resident functions:

note

The general requirements for a resident function:

  1. The script should be written in JavaScript.

  2. The script should define a function which performs some business logic on regulated data.

When to use resident functions

You need to use resident functions for implementing custom scenarios for the redaction and restriction data regulation models. If you are using the replication data regulation model, you do not need to use resident functions.

Primary use cases for resident functions are the following:

  • Validation of record uniqueness by full name and/or email address.

  • Custom calculations of values for specific profiles.

Resident functions allow you to execute custom operations on regulated data within the Point-of-Presence where it is originally stored and do not transfer it to your application server, which may automatically cause violation of the local compliance requirements and regulations.

Viewing resident functions

  1. Expand the environment and country in the left sidebar where you have created the Resident Functions service.

  2. Click the Services menu item.

  3. On the list with services, locate the service of the Resident Functions type.

  4. Click the Resident functions icon. You may be prompted to enter the Client Secret pertaining to the service of the Resident Functions type.

  5. On the opened page, enter the Client Secret that you received upon the service creation. Upon the entry of a valid Client Secret, the New Function button becomes active and the list of resident functions is displayed if any functions exist.

Here you can view the following information about the available resident functions:

AttributeDescription
NameName of a resident function.
CreatedDate when a resident function was created.
UpdatedDate when a resident function was updated.

Adding a new resident function

  1. Expand the environment and country in the left sidebar where you want to add a resident function.

  2. Click the Services menu item.

  3. On the list with services, locate the service of the Resident Functions type.

  4. Click the Resident functions icon.

  5. On the opened page, enter the client secret that you received upon the service creation. Upon the entry of the valid client secret, you will see the list of resident functions or a page with the empty state.

  6. Click Add function.

  7. On the opened page, specify the following information:

    • Function name - enter the name of a resident function.

    • Function body - enter the code of the resident function.

  8. When complete, click Publish.

Once you have published a resident function, you can call it and execute against regulated data stored on InCountry DRaaS.

info

When you publish a resident function, it is saved on InCountry Portal, then passed to REST API which saves it further to PoP API on the InCountry platform.

Editing the resident function

  1. On the list with resident functions, locate the resident function you want to edit.

  2. Click the Configure icon.

  3. On the opened page, update the resident function’s code as required.

  4. When complete, click Update.

note

Once the resident function has been published, you cannot modify its name.

Executing the resident function

  1. On the list with resident functions, locate the resident function you want to edit.

  2. Click the Configure icon.

  3. On the opened page, add the parameters required for the execution of the resident function by clicking Add parameter.

  4. For each added parameter, specify the following information:

    • Name - name of the parameter.

    • Value - value of the parameter.

  5. If you have added some parameter by mistake, delete it by clicking the Remove icon.

  6. When complete, click Execute. The resident function will output the execution results into the console.

info

When you execute a resident function, the REST API fetches the required resident function by its name from PoP API and executes its code against records stored on the InCountry platform.

Deleting the resident function

  1. On the list with resident functions, locate the resident function you want to delete.

  2. Click the Delete icon.

  3. Confirm the removal of the resident function.