Transform your data without code
On this page
You can add transformations to your connector’s destination to manipulate data before it’s written to your Algolia indices.
To use transformations, create a task that specifies the data source and the destination (usually an Algolia index). Add transformations during task creation or apply them directly to existing destinations.
To learn more about connectors, read the Connectors overview.
No Code transformations are defined through a form-based interface.
You can only add one transformation to a destination.
Get started with NoCode transformations
- Go to the Algolia dashboard and select your Algolia application.
- On the left sidebar, select Data sources.
- Open the Connectors page.
- Select a connector and click Connect to start creating your task.
- Configure your data source: create a new source or select an existing one.
- To create your transformation function, click Create transformation, and select ‘Transform without code’
- Configure your destination: create a new destination or select an existing one.
- Configure when your task should run and specify the operation type for writing your Algolia index records.
- Confirm whether you want to run your task immediately. To see your transformation in action, click Run and inspect your index records after the task finishes.
Create your transformation
A No Code Transformation consists of one or more steps that you configure. Each step can optionally include a condition, so it only applies to records that meet specific criteria.
If any of the steps fail, the entire transformation will be marked as failed.
Available step types
Step type | Description |
---|---|
Add record attribute | Add a new attribute to a record. The value can be a fixed value or calculated from other attributes in the record |
Remove record attribute | Remove an attribute from a record |
Remove records | Remove records based on a condition. For example, you can remove records with a price below a certain threshold |
Add Attribute step
Use the Add Attribute step to create a new attribute in your records, or to update the value of an existing one. Here’s how to configure this step:
Adding an attribute to a record.
- Choose Add Attribute as the step type
- Enter the name of the attribute you want to add. You can also specify an existing attribute to update its value. For nested attributes, use dot notation (for example,
prices.discount_pct
). - Optional: Add a condition to control when this step is applied
- Set the value for the attribute. This can be:
- A static value (for example,
true
,10
, or"new"
) - A computed value based on other attributes in the record (for example,
price * discount_pct
). See Computed values for more information
- A static value (for example,
If you specify an attribute that already exists, its value will be overwritten.
Computed values
The value you assign to an attribute can be a computed value.
A computed value can be based on other attributes in the record. For example, if you want to calculate the discounted price of a product, you can use the following formula:
price * (1 - discount_pct)
Where price
is an attribute in the record and discount_pct
is another attribute in the record.
A number of functions are available to help you calculate computed values, covering common operations like arithmetic, string manipulation, and date/time calculations.
See the Function reference for a full list of available functions.
Remove Attribute step
Use the Remove Attribute step to delete an attribute from your records. This is useful for cleaning up data or removing fields you don’t want to send to your Algolia index.
Removing an attribute from a record.
- Choose Remove Attribute as the step type
- Enter the name of the attribute you want to remove. For nested attributes, use dot notation (for example,
prices.discount_pct
). - Optional: Add a condition to control when this step is applied
If you specify a nested attribute using dot notation, only that nested field will be removed, not the entire object.
Remove records step
Use the Filter Records step to remove records from your index based on specific conditions. This is useful for excluding records that don’t meet your criteria before sending them to your Algolia index.
Remove records based on a condition.
- Choose Filter Records as the step type
- Optional: Add a condition to control when this step is applied. Only records that meet these conditions will be kept; others will be removed
Conditions
Conditions let you control when a transformation step runs for a particular record. They are used in both the Add Attribute and Filter Records steps:
- Add Attribute: Only add or modify an attribute if the condition is met.
- Filter Records: Only keep records that meet the condition; others are filtered out.
- Remove Records: Only remove records that meet the condition; others are kept.
What makes up a condition?
A condition is defined using a form-based interface and consists of:
- Field: The attribute of the record to check (for example,
category
,price
) - Operator: The comparison to perform (for example,
equals
,does not equal
,less than
,less than or equal
,greater than
,greater than or equal
) - Attribute type: The data type of the field (for example, string, number, boolean). This tells the condition how to compare the field to the value
- Value: The value to compare against (for example,
"food"
,200
,true
)
Example: A basic condition
The following condition checks if the category
field equals "food"
:
An example of a basic condition.
Combining multiple conditionals
You can combine multiple conditionals using AND and OR logic. For example:
category equals "food" AND price < 200
For more complex logic, you can group conditionals together, this is similar to using parentheses in a formula.
category equals "food" AND (price < 200 OR discount == true)
An example of a complex, grouped condition.
Tip: Grouping conditions changes the order in which conditions are evaluated, allowing for advanced logic.
Supported types
The following attribute types are supported:
Attribute Type | Description |
---|---|
string | A string of text, for example: “food” |
number | A number, for example: 200 |
boolean | A boolean value, for example: true or false |
Array and object types are not currently supported in No Code transformations.
Conditions summary
- Use conditions to precisely control when transformation steps apply
- Combine and group conditionals for advanced logic
- Visualize and build conditions easily with the form-based interface
Preview your transformation
At any point during setup, you can preview your transformation. The preview feature lets you apply your transformation to a sample of your data, so you can compare the results before and after the changes.
If you data source does not support previewing, you can still preview your transformation by copying a sample record into the text area available in preview.
Not all data sources support previewing.
Limitations
- You can only add one transformation to a destination
- Support for data sampling in preview is limited to a subset of data sources. The following data sources support sampling:
- Algolia Index
- CSV
- JSON
- Edits to a transformation do not support sampling
- You can only use either no code or code transformations, not both, for a given task
- Transforming complex records structures (arrays and objects) is not supported
Function reference
Various functions are available to help you calculate computed values, covering common operations like arithmetic, string manipulation, and date/time calculations.
Some examples include:
Function | Description | Example usage |
---|---|---|
mean([x, y, ...)] |
Returns the mean of the numbers. | mean([1, 2, 3]) → 2 |
median([x,y, ...]) |
Returns the median of the numbers. | median([1, 2, 3]) → 2 |
round(x) |
Rounds x to the nearest integer. |
round(2.5) → 3 |
max(a, b) |
Returns the largest of two values | max(1, 5) → 5 |
min(a, b) |
Returns the smallest of two values. | min(1, 5, 3) → 1 |
len(x) |
Returns the length of a string. | len("abc") → 3 |
lower(x) |
Converts a string to lowercase. | lower("HELLO") → "hello" |
upper(x) |
Converts a string to uppercase. | upper("hello") → "HELLO" |
replace(s, old, new) |
Replace all occurrences of old with new in s . |
replace("foo", "o", "a") → "faa" |
trim(str[,chars]) |
Trim whitespace from start and end of string. Optionally trim chars |
trim(" foo ") → "foo" |
split(s, sep) |
Splits string s into an array using separator sep . |
split("a,b,c", ",") → ["a","b","c"] |
join(arr, sep) |
Joins elements of array arr into a string, separated by sep . |
join(["a","b"], ",") → "a,b" |
uniq([x,y,...] ) |
Removes duplicate values from an array. | uniq([1, 2, 2, 3]) → [1, 2, 3] |
now() |
Returns the current time. | now() → "2024-06-07T12:34:56Z" |
For a full list of available functions, see the Expr language documentation.