0

I am triggering TS after form submission and have problems with one of attributes. This is error message:

Main content block error: {"message":"The function expression is invalid. See inner exception for detail.\r\n Script: AddObjectArrayItem(@TriggerSend, "Attributes", @submittedNumber)\r\n Index: 50938\r\n ListID: 0\r\n","description":"ExactTarget.OMM.InvalidScriptException: The function expression is invalid. See inner exception for detail.\r\n Script: AddObjectArrayItem(@TriggerSend, "Attributes", @submittedNumber)\r\n Index: 50938\r\n ListID: 0\r\n Error Code: OMM_FUNC_EXPR_INVALID\r\n - from Jint --> \r\n\r\n --- inner exception 1---\r\n\r\nExactTarget.OMM.FunctionExecutionException: An error occurred when attempting to evaluate a AddObjectArrayItem function call. See inner exception for details.\r\n Error Code: OMM_FUNC_EXEC_ERROR\r\n - from OMMCommon --> \r\n\r\n --- inner exception 2---\r\n\r\nSystem.InvalidCastException: Object cannot be stored in an array of this type. - from mscorlib\r\n\r\n\r\n\r\n\r\n\r\n"}

This is part of AMPscript causing error:

   /*--submittedNumber--*/
   SET @TriggerSendsubmittedNumber = CreateObject("Attribute")
   SetObjectProperty(@TriggerSendsubmittedNumber, "Name", "submittedNumber")
   SetObjectProperty(@TriggerSendsubmittedNumber,"Value", @submittedNumber)
   AddObjectArrayItem(@TriggerSend, "Attributes", @submittedNumber) 

When I delete whole TS script and instead output @submittedNumber variable it works correctly and displays a number.

In the TS data extension this field is a Text fields but I don't think that would be causing any problems? What does this error mean, Object cannot be stored in an array of this type?

1 Answer 1

2

Instead of this:

AddObjectArrayItem(@TriggerSend, "Attributes", @submittedNumber) 

Should be this:

AddObjectArrayItem(@TriggerSend, "Attributes", @TriggerSendsubmittedNumber) 

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .