BuildRowSetFromString

This function returns a row set by splitting a string by the specified delimiter string.

Arguments

BuildRowSetFromString(1,2)

Ordinal Type Required Description
1 String True String to split into a row set
2 String True Delimiting string

Example 1

Values returned in the row set are not named. They are specified with an ordinal of 1 as illustrated in the following example:

%%[
var @regionList, @rows, @row, @rowCount, @region, @i

set @regionList = "North**South**East**West"

set @rows = BuildRowsetFromString(@regionList,"**")
set @rowCount = rowCount(@rows)

if @rowCount > 0 then

  for @i = 1 to @rowCount do

    var @region
    set @row = row(@rows, @i) /* get row based on counter */
    set @region = field(@row,1)

    ]%%

    <br>Row %%=v(@i)=%%, region: %%=v(@region)=%%

    %%[

  next @i ]%%

%%[ else ]%%

No rows found

%%[ endif ]%%

Output

Row 1, region: North
Row 2, region: South
Row 3, region: East
Row 4, region: West

Example 2


Not a subscriber? Subscribe now.