1

I am having problems with updating a row in a data extension (DE). Usually my DE only has one primary key. In this case there are three. When I have it like the code below, all rows that has the same country_code are updated.

But I just want to update rows where country_code AND program AND e_number match. How should I write that final row to make it happen?

<script runat=server>
Platform.Load("core","1");

var e_number = Request.GetFormField("e_number");

requestsDE.Rows.Update({
e_subline: 'bla bla bla'
},
["country_code"], [countrycode], ["program"], [program],["e_number"], [e_number]
);
</script>

The field in the DE is numeric. However I guess "e_number" that I receive from a form is a string. Might that also be a problem?

2

You were almost there - you need to combine all the columns and values into a single array, not multiple arrays like in your example. Likely it was only filtering on the first 2 arrays (name | value) and ignoring the rest as they are not included in the function properties.

See below:

<script runat=server>
Platform.Load("core","1");

var e_number = Request.GetFormField("e_number");

requestsDE.Rows.Update({
e_subline: 'bla bla bla'
},
["country_code", "program", "e_number"], [countrycode, program, e_number]
);
</script>

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.