Data Transformation

Data transformation components convert and combine data between different formats and structures for seamless workflow integration.

Combine Data

This component combines multiple data sources into a single unified Data object.

The component iterates through the input list of data objects, merging them into a single data object. If the input list is empty, it returns an empty data object. If there's only one input data object, it returns that object unchanged. The merging process uses the addition operator to combine data objects.

Inputs

Name
Display Name
Info

data

Data

A list of data objects to be merged.

Outputs

Name
Display Name
Info

merged_data

Merged Data

A single Data object containing the combined information from all input data objects.

Combine Text

This component concatenates two text sources into a single text chunk using a specified delimiter.

  1. To use this component in a flow, connect two components that output Messages to the Combine Text component's First Text and Second Text inputs. This example uses two Text Input components.

  2. In the Combine Text component, in the Text fields of both Text Input components, enter some text to combine.

  3. In the Combine Text component, enter an optional Delimiter value. The delimiter character separates the combined texts. This example uses \n\n **end first text** \n\n **start second text** \n to label the texts and create newlines between them.

  4. Connect a Chat Output component to view the text combination.

  5. Click Playground, and then click Run Flow. The combined text appears in the Playground.

This is the first text. Let's combine text!
end first text
start second text
Here's the second part. We'll see how combining text works.

Inputs

Name
Display Name
Info

first_text

First Text

The first text input to concatenate.

second_text

Second Text

The second text input to concatenate.

delimiter

Delimiter

A string used to separate the two text inputs. Defaults to a space.

Outputs

Name
Display Name
Info

message

Message

A Message object containing the combined text.

Message to Data

This component converts Message objects to Data objects.

Inputs

Name
Display Name
Info

message

Message

The Message object to convert to a Data object.

Outputs

Name
Display Name
Info

data

Data

The converted Data object.

Data to DataFrame

This component converts one or multiple Data objects into a DataFrame. Each Data object corresponds to one row in the resulting DataFrame. Fields from the .data attribute become columns, and the .text field (if present) is placed in a 'text' column.

  1. To use this component in a flow, connect a component that outputs Data to the Data to Dataframe component's input. This example connects a Webhook component to convert text and data into a DataFrame.

  2. To view the flow's output, connect a Chat Output component to the Data to Dataframe component.

  3. Send a POST request to the Webhook containing your JSON data. Replace YOUR_FLOW_ID with your flow ID. This example uses the default BroxiAI server address.

curl -X POST "https://use.broxi.ai/api/v1/webhook/YOUR_FLOW_ID" \
-H 'Content-Type: application/json' \
-d '{
    "text": "Alex Cruz - Employee Profile",
    "data": {
        "Name": "Alex Cruz",
        "Role": "Developer",
        "Department": "Engineering"
    }
}'
  1. In the Playground, view the output of your flow. The Data to DataFrame component converts the webhook request into a DataFrame, with text and data fields as columns.

| text                         | data                                                                    |
|:-----------------------------|:------------------------------------------------------------------------|
| Alex Cruz - Employee Profile | {'Name': 'Alex Cruz', 'Role': 'Developer', 'Department': 'Engineering'} |

Inputs

Name
Display Name
Info

data_list

Data or Data List

One or multiple Data objects to transform into a DataFrame.

Outputs

Name
Display Name
Info

dataframe

DataFrame

A DataFrame built from each Data object's fields plus a 'text' column.

Usage Notes

  • Format Conversion: Seamlessly convert between Message, Data, and DataFrame formats

  • Data Aggregation: Combine multiple data sources into unified structures

  • Workflow Integration: Enable smooth data flow between different component types

  • Flexible Transformation: Support for various data transformation patterns

  • Structured Output: Convert unstructured messages into structured, analyzable formats

Last updated