I'm doing a lookup of a data extension and bringing a name-value pair back in my code. Is there a means of casting the result as a variable name?
FOR @preferencePageIndex = 1 TO RowCount(@preferencePage) DO SET @pagename = Field(Row(@preferencePage,@preferencePageIndex),"Name") SET @pagevalue = Field(Row(@preferencePage,@preferencePageIndex),"Value") // Here...Set Value of @pagename result AS a new Variable NEXT @preferencePageIndex
In other words, if the result of the name is equal to "Heading" and the value is "Preference Page", then I'd like to be able to have the loop declare a variable, name it, and then set the value:
VAR @Header SET @Header = "Preference Page"
I'm bringing back quite a result set and don't want to hardcode each variable to the result. I want to leave this quite flexible. Or, is the better approach for me to just put it in an array, pass it to SSJS and deal with it there?