I'm using the following bit of code to create a series of data extensions. I'm trying to create the name from a concatenation of Job_Ref and Creative_Name from a reference database.
%%[
/*Using this name, find how many creative_number variants it has*/
set @crs = LookupOrderedRows("UM_CreativeSplit",0,"Creative_Name ASC","Job_Ref",@name)
set @crc = Rowcount(@crs)
set @cr = Row(@crs,1)
set @cn = Field(@cr,'Creative_Name')
]%%
DE Rowcount %%=v(@crc)=%%<br>
%%[
/*CREATE THE DATA EXTENSIONs*/
For @cr = 1 to @crc do
set @dename = Concat(@name,"_",@cr)
]%%
This version just uses the loop counter number (@cr) and appends it to the name (which is set previously to this part of the code using Field(@r,'job_ref').
As you can see, before the For loop I have
set @cn = Field(@cr,'Creative_Name')
Which works correctly. However, when I use this inside the For loop, I get the following error
Error Message: Invalid object property name. Object Type: System.Int64 Property Name: Creative_Name Description: An unexpected error occurred during the execution of the page.
Why doesn't it work inside the For loop? I want to be able to cycle through these.
@name
?