---
schema_version: "1"
id: 145836b3f1619bd70a14400f04cd25e85540c5d9900e4ac564fae3a4023235c1
title: BuildRowSetFromString()
collection: developer
version: current
locale: en-us
portal_url: https://docs.salesforce.com/developer/current/en-us/marketing-cloud/ampscript/references/content/mc-ampscript-reference-content-build-rowset-from-string.md
canonical_url: https://developer.salesforce.com/docs/marketing/marketing-cloud-ampscript/references/mc-ampscript-content/mc-ampscript-reference-content-build-rowset-from-string.html
source_site: developer.salesforce.com
content_type: documentation
content_hash: 954a953d42495560f1db2792272ce238d92597e64194616923033d1965b3f84f
products:
  - AMPscript for Marketing Cloud
  - Marketing Cloud
---
# BuildRowSetFromString()

Creates a rowset from a character string by splitting the string at the specified delimiter.

## Availability

<table>
  <tr>
    <td>Marketing Cloud Engagement</td>
    <td>✅ Yes</td>
  </tr>
  <tr>
    <td>Marketing Cloud Next</td>
    <td>✅ Yes</td>
  </tr>
</table>

## Syntax

```
BuildRowSetFromString(sourceData, delimiter)
```

The `BuildRowSetFromString()` function has two parameters:

- `sourceData` (string): Required. A string that contains the data to load into a rowset.
- `delimiter` (string): Required. The character (such as a comma) that is used as a delimiter in the source data.

## Usage

To call the function, pass it the string of data that you want to convert to a rowset, and the character that is used as a delimiter in the source data.

### Basic Usage

This example creates a variable with a string of data, and another variable that contains the delimiter for that data. The example uses these variables to create a rowset from the string of data.

```
%%[
  Set @dataString = "123|456|789"
  Set @dataDelimiter = "|"
  BuildRowsetFromString(@dataString, @dataDelimiter)
]%%

```

The example returns a rowset with three rows.

```
123
456
789
```

### Processing Attribute Names

This example shows how to pass and process attribute names.

```
%%[
  Var @queryparams
  Var @row
  Var @name
  Var @value
  Set @queryparams = BuildRowsetFromString(QueryParameter('names'),'|')
  For @i = 1 to Rowcount(@queryparams) do
    Set @row = Row(@queryparams, @i)
    Set @name = Field(@row,1)
    Set @value = QueryParameter(@name)
  ]%%
  Passed <b>name:</b> %%=v(@name)=%% with <b>value:</b> %%=v(@value)=%%<br/>
  %%[
  next @i
]%%
```

When passed the following input:

```
names=career|firstname|lastname&career=marketer&firstname=Angela&lastname=Ruiz
```

The function returns:

```
Passed name: career with value: marketer
Passed name: firstname with value: Angela
Passed name: lastname with value: Ruiz
```

Because this function returns the rowset in one column, and this column doesn’t have an assigned name, you refer to the column within a function using an ordinal number:

```
Field(Row(BuildRowSetFromString('123|456', '|'), 1), 1)
```
