Creates a rowset from a character string by splitting the string at the specified delimiter.
Availability
Marketing Cloud Engagement
✅ Yes
Marketing Cloud Next
❌ No
Syntax
1BuildRowSetFromString(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.
1%%[2 Set @dataString = "123|456|789"3 Set @dataDelimiter = "|"4 BuildRowsetFromString(@dataString, @dataDelimiter)5]%%
The example returns a rowset with three rows.
112324563789
Processing Attribute Names
This example shows how to pass and process attribute names.
1%%[2 Var @queryparams3 Var @row4 Var @name5 Var @value6 Set @queryparams = BuildRowsetFromString(QueryParameter('names'),'|')7 For @i = 1 to Rowcount(@queryparams) do8 Set @row = Row(@queryparams, @i)9 Set @name = Field(@row,1)10 Set @value = QueryParameter(@name)11 ]%%12 Passed <b>name:</b> %%=v(@name)=%% with <b>value:</b> %%=v(@value)=%%<br/>13 %%[14 next @i15]%%
1Passed name: career with value: marketer2Passed name: firstname with value: Angela3Passed 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: