AI Prompts
Feature overview
With AI Prompts, our Importer enables AI-powered bulk edits directly in the review step. Users can transform values using natural language, with JavaScript functions generated and executed in the browser, ensuring your data never leaves it.
Benefits
- Execute bulk edits for data cleaning faster, without writing custom code
- Keep all uploaded data inside the browser — only the prompt and target data model are processed on our servers
- Reduce development workload by enabling users to handle their own data cleaning
- Support a wide range of common data transformation scenarios
- Complement the Contextual Engine and Cleaning Assistant for comprehensive data transformation and cleaning
How it works
- The user selects a column in the review step
- Enters a prompt describing the desired transformation
- The importer generates a JavaScript function that applies the described operation to the values of the selected column
- Merge columns
- Split columns
- Cross-column completion
- Cross-column calculations
- Reformatting
Prompt: "Merge @First Name and @Last Name together with a space"
Prompt: "Split @First Name and @Last Name into separate columns"
Prompt: "If @City is Munich, Hamburg, or Frankfurt add Germany"
Prompt: "Multiply @Cost and @Quantity"
Prompt: "Add +49 to all phone numbers if @Country is Germany"
Functionality
- Cleanings are executed once for each entry in the selected column
- When another column is referenced, the current values in that column are used
- If a value in a referenced column changes, the value in the cleaned column is not updated automatically
- Changes are not automatically (re)applied to manually added rows or modified data
- When a cleaning is applied,
onEntryChangeis called using theactionType"applyPrompt"or"removePrompt"
Column availability
For cleanings to work properly, ensure that all columns required for the cleaning are available in the review step. There are two ways to achieve this:
- Known output columns: Add all necessary columns to the target data model
- Unknown output columns: Enable
allowCustomColumnsin the importersettingsto allow users to add the required columns
In both cases, filter out any columns in onResults that were added solely for cleaning purposes but should not be included in the final output.
Helper functions
Alongside standard JavaScript, the Function field supports a fixed set of helpers for removing rows.
| Helper | Removes |
|---|---|
REMOVE_ROW() | The current row, when a given condition is met |
REMOVE_DUPLICATE_ROWS() | Rows that duplicate an earlier row across all visible columns |
REMOVE_DUPLICATE_ROWS_BY(...) | Rows that duplicate an earlier row across the listed columns |
REMOVE_EMPTY_ROWS() | Rows in which every visible column is empty |
REMOVE_EMPTY_ROWS_BY(...) | Rows in which every listed column is empty |
Conditional removal
REMOVE_ROW() is evaluated row by row. It can only be used as the result of a condition, never as the condition itself or as part of a calculation:
@Stock === 0 ? REMOVE_ROW() : @Status
Sheet-wide helpers
The REMOVE_DUPLICATE_ROWS and REMOVE_EMPTY_ROWS helpers act on the whole sheet. When one of them is used, it must be the only content of the function, so it cannot be combined with another helper, a condition, or any other JavaScript.
The _BY variants require at least one column, referenced with @Column label. The variants without _BY compare every column that is currently visible in the review step.
Two optional flags can be passed to the duplicate helpers only. They can be listed in any order.
| Flag | Effect |
|---|---|
IGNORE_CASE | Compares text values regardless of upper or lower case |
IGNORE_BLANKS | Never removes a row that has a blank value in any of the compared columns |
REMOVE_DUPLICATE_ROWS()
REMOVE_DUPLICATE_ROWS_BY(@Product ID, IGNORE_CASE, IGNORE_BLANKS)
REMOVE_EMPTY_ROWS()
REMOVE_EMPTY_ROWS_BY(@Email, @Phone)
Every helper scans only the rows that are currently visible in the review step, so active filters limit its scope. Example rows shown through enableExamples are never removed.
Implementation details
Enabling the feature
Enable the feature in the settings object in the DataImporter component by adding prompts and setting it to true. If this feature isn't part of your plan, contact our sales team or customer success team to get it unlocked.
Prompt examples
- Users can access 3–5 predefined prompts as well as 3–5 function examples
- You can customize these examples via i18n
- Each example can be tailored to specific use cases
- Users can then use these examples as a guide to write their own prompts
Add examples for prompts using these i18n keys:
"txt_prompts_prompt_example_1"
"txt_prompts_prompt_example_2"
"txt_prompts_prompt_example_3"
"txt_prompts_prompt_example_4"
"txt_prompts_prompt_example_5"
Add examples for functions using these i18n keys:
"txt_prompts_function_example_1"
"txt_prompts_function_example_2"
"txt_prompts_function_example_3"
"txt_prompts_function_example_4"
"txt_prompts_function_example_5"