How can we separate one column value having comma as delimiter using Ampscript. Example : We have hello, world in ABC Data Extension in Column "Name" I want to separate both of them using Ampscript. As a result, put hello in column "ID" and world in column "Name".


You can use BuildRowSetFromString. It basically creates a rowset from a String using a delimiter.

You should use something like:

Set @queryparams = BuildRowsetFromString(@ColumnValue,',')
for @i = 1 to Rowcount(@queryparams) do
Set @row = Row(@queryparams, @i)
Set @value = Field(@row,1)

You can then use @value values in your UpdateData or UpdateDE depending on the context (Landing page or Email).


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.