I'm trying to add a row in a Data Extension using the following code:

<script runat="server">
  try {
        var deRows = {offer_id:"10000",title:"Test",priceForEndUser:"70000",dealer_neighborhood:"Test"};
        var dataExtension = DataExtension.Init("teste_offers");
        var dmlResult = dataExtension.Rows.Add(deRows);

  catch (ex) {
    Platform.Response.Write("An error occurred: " + ex);

I'm debugging the code using Cloud Pages and the variable dmlResult always return 0 and no data is inserted.

I also tried the Platform.Function.InsertData statement but it returns me this error 'An error occurred: An error occurred when attempting to execute an InsertData function call. See inner exception for details.'

Here is my DE: Data Extension

  • 1
    I created the exact DE as above and used ur exact code .. and it worked!... and dmlResult returned '1'... so the code and DE look good... Can u confirm if your DE is stored locally and NOT in a shared DE? Jun 2 at 5:51
  • @VishalKumarCV Yep It's stored in this path Data Extensions > Testes > teste_offers in tha main BU. Could it be some kind of permission?
    – Leonardo
    Jun 2 at 11:27
  • Might be, as there is NO error instead you getting 0 count... its hard to debug.... I suggest to create another DE and test it. Jun 5 at 8:51


You must log in to answer this question.

Browse other questions tagged .