Transforms

Create an Attribute Transform

Create a new attribute transform.

post/attribute_transforms

Request

Request body

namestring required
descriptionstring
output_type'attribute' required

Type of code container. This must be set to attribute to signify that this code container is to be used for generating the value of an output attribute.

reusableboolean required

Whether or not this transform can be referenced by multiple Nexsets. This should always be true for reusable transforms.

code_type'python' | 'python3' | 'javascript' required

Type of code in the code block.

code_encoding'base64' required

Whether or not the code in the code block is encoded. Set this to base64 for reusable attribute transforms.

codestring required

Code to be executed for transforming records. If you wish to execute a Python or Javascript code snippet during transformation, you'll need to base64-encode that code snippet.

For example, if you want to execute this Python code as a reusable record transform

def transformAttribute(input, metadata, args):
  return input.get(args[0])

the corresponding code value would be

ZGVmIHRyYW5zZm9ybUF0dHJpYnV0ZShpbnB1dCwgbWV0YWRhdGEsIGFyZ3MpOgogIHJldHVybiBpbnB1dC5nZXQoYXJnc1swXSk=
custom_configobject

Configuration block useful for converting code into Nexla UI's Nexset Designer Rule blocks.

This should not be sent in the payload unless the transform is being created using the Nexla UI's Nexset Designer screen.

tagsstring[]

Response

Success

idinteger
namestring
resource_type'transform'
reusableboolean
access_rolesstring[]

This property reflects all the permissions the user/team/organization has to this resource.

  1. collaborator: The user/team/organization can view the resource but not make any modifications to it.
  2. operator: The user/team/organization can view the resource and can activate/pause it, but not make any other modifications to it.
  3. administrator: The user/team/organization has complete administrative rights to this resource.
  4. owner: This user created the resource and so has complete administrative rights to it.
descriptionstring
code_type'python' | 'javascript'
output_type'attribute'
code_configobject
custom_configobject
code_encodingstring
codestring
managedboolean
data_setsinteger[]
copied_from_idinteger
updated_atstring date-time
created_atstring date-time
tagsstring[]

Example response

{
  "id": 1,
  "name": "test",
  "description": "test",
  "code_encoding": "none"
}

Changes

No recorded changes to this operation across all 1 revision of this API.