As per your comment, you are attempting to use rows.Update
from child BU on a Shared DE.
Shared DE location means it is treated like being located in parent.
Your code does not work as you are in the wrong context (child trying to update parent). This can be done though using the "ENT." prefix. (= ENTerprise context)
It's just that the function Rows.Update
, which is in the SSJS Core Library, works on the customerkey of the Data Extension, which cannot be prefixed with "ENT.".
Once you use a method that works with the name of the DE - SSJS Platform functions or AMPScript - you can use the ENT.prefix before the data extension name like Platform.Function.UpsertData("ENT.myDE", ...)
to do exactly that. It does not help the other way around (from parent to child).
Here is an example with a Shared DE that has one PK (subKey) and one other field, executed successfully on a cloudpage in child BU.
You actually don't need the Platform.Load("Core",1)
bit here, as we are not using a Core, but a Platform Function, which works without loading the Core library. I'll include it regardless as your other code might need it.
<script runat="server" type="javascript">
Platform.Load("Core","1");
try {
Platform.Function.UpsertDE("ENT.jltest",["subKey"],["777777"],["Email"],["[email protected]"])
} catch (err) {
Write(Stringify(err));
}
</script>
Whether upsertDE or upsertData is right for your usecase depends.
for brevity's sake let's just say upsertDE is for cloudpages, upsertData is for emails.
https://developer.salesforce.com/docs/atlas.en-us.noversion.mc-programmatic-content.meta/mc-programmatic-content/ssjs_platformDataExtensionUpsertData.htm
https://developer.salesforce.com/docs/atlas.en-us.noversion.mc-programmatic-content.meta/mc-programmatic-content/ssjs_platformDataExtensionUpdateDE.htm