Create a transformer

Introduction

Transformers are re-usable JavaScript functions that manipulate data in UserClouds. Transformers control how a token is generated and what it looks like. Transformers allow you to retain select structure and information from the raw data for different use cases, like sorting alphabetically, common domain analysis or simply flowing through your systems without triggering validation errors.

Transformers can be managed in the User Store page of the UserClouds Console, or via the UserClouds API.

Transformers can be managed from the Policies page in the UserClouds Console

Transformers can be managed from the Policies page in the UserClouds Console

Creating a transformer in UserClouds Console

To create a transformer in UserClouds, go to the Policies page, accessible from the sidebar in Console, and click Create Transformer.

1 Name and Describe the Transformer

Specify a name and description for the transformer, to help your team find and use it later.

2 Define how the transformer will change the data

Define how the transformer will work by stating:

  • An input data type for the transformer (string, timestamp etc)
  • A transform type - for more info on these, see
  • A transform function, which will receive raw data and return the transformed data
  • (Optional) A set of parameters for that function, which allows you to rapidly create transformers with parallel logic

3 Test and save your transformer

Finally, test your transformer by adding raw data to the "Data" field and clicking "Run Test". Once you are happy with the test results, click "Save Transformer" to finish.

The Create Transformer Page

The Create Transformer Page

Creating a transformer via the API

To learn how to create a transformer via the UserClouds API, see our API Reference.