Skip to main content

Managing resident functions

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:

  • publishing new resident functions

  • re-publishing the existing resident functions

  • executing the published 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. Open the environment where you have created the Resident Functions service.

  2. Click the Services block.

  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 integration creation. Upon the entry of the valid Client Secret, the New Function button becomes active and the list with resident functions is displayed.

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.

Publishing a new resident function

  1. Open the environment where you have created the Resident Functions service.

  2. Click the Services block.

  3. On the list with services, locate the integration 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, the New Function button becomes active.

  6. Click New 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.

You can switch to another service of the Resident Functions type by selecting another service in the corresponding dropdown box and entering an appropriate Client Secret for this newly selected service.

Important

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 Point-of-Presence.

Editing the resident function

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

  2. Click the Edit icon.

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

  4. When complete, click Update.

Executing the resident function

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

  2. Click the Execute 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.

Important

When you execute a resident function, REST API fetches the required resident function by its name from PoP API and executes its code against records stored in the Point-of-Presence.

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.