---
title: Transform using Gen AI
description: Use generative AI and Python to apply custom data transformations based on prompt instructions.
category: Data Transformation
tags: [genai, transformation, prompt, python, ai]
---

# Transform using Gen AI

## Description

The **Transform using Gen AI** activity allows users to define a custom data transformation using a natural language **Prompt**. Infoveave’s generative AI engine interprets this prompt, generates Python code, and applies the transformation to the tabular input.

This activity is powerful when:

- Custom business logic needs to be applied to datasets (e.g., filling missing values, formatting dates)
- Users want to automate repetitive data wrangling tasks without coding manually
- AI-assisted logic can infer transformation rules from examples or intent

> **Use case**:  
> Suppose salary data has missing entries. You can write a prompt like _"Fill missing salary values with the average of available salaries"_ — and Gen AI will compute the average and apply the transformation dynamically using generated Python.

## Input

| **Field** | **Required** | **Description**                                         |
| --------- | ------------ | ------------------------------------------------------- |
| Data      | Yes          | Structured input data with at least one row and column. |

## Output

| Output Type | Format  | Description                                          |
| ----------- | ------- | ---------------------------------------------------- |
| **Data**    | Tabular | Transformed version of the input data as per prompt. |

## Configuration Fields

| Field Name | Description                                                                                    |
| ---------- | ---------------------------------------------------------------------------------------------- |
| **Prompt** | Required. A user-defined instruction in natural language describing how to transform the data. |
| **Code**   | (Auto-generated) Python code generated by the AI model based on the prompt. Can be reviewed.   |

---

## Sample Input

| SalesPerson | Name          | Department | Salary | JoinDate   |
| ----------- | ------------- | ---------- | ------ | ---------- |
| 101         | John Doe      | HR         | 50000  | 2020-01-15 |
| 102         | Jane Smith    | IT         |        | 2019-03-10 |
| 103         | Alice Johnson | Finance    | 60000  | 2021-06-25 |
| 104         | Bob Williams  | Marketing  |        | 2018-09-12 |
| 105         | Emma Brown    | Sales      | 65000  | 2022-02-20 |

---

## Sample Configuration

| Field  | Value                                                           |
| ------ | --------------------------------------------------------------- |
| Prompt | Fill missing salary values with the average of existing ones.   |
| Code   | _(Auto-generated Python code to calculate average and replace)_ |

---

## Sample Output

| EmployeeID | Name          | Department | Salary | JoinDate   |
| ---------- | ------------- | ---------- | ------ | ---------- |
| 101        | John Doe      | HR         | 50000  | 2020-01-15 |
| 102        | Jane Smith    | IT         | 58333  | 2019-03-10 |
| 103        | Alice Johnson | Finance    | 60000  | 2021-06-25 |
| 104        | Bob Williams  | Marketing  | 58333  | 2018-09-12 |
| 105        | Emma Brown    | Sales      | 65000  | 2022-02-20 |
