There are multiple levels here.
- The error message from your comment will point you exactly to the root cause, if you know how to interpret it and read docs.
Documentation says:
https://developer.salesforce.com/docs/marketing/marketing-cloud/guide/ssjs_dataExtensionRowsRetrieve.html
Syntax is:
Rows.Retrieve(1)
You are calling Rows.Retrieve() without something in the bracket.
The thing in the bracket is called an argument.
The documentation then says what this argument should be:
1 ... Specifies information to filter for the retrieve
So you cannot retrieve without a filter. You need to "put a filter in the bracket"
If you check the documentation example then you will see how such a filter should look:
{Property:"Age",SimpleOperator:"greaterThan",Value:20};
This is an object, which you'll recognize by the curly brackets (I am oversimplifying). The error message says that Retrieve cannot work due to an "Object expected".
So: The missing filter is exactly that "object expected" by the function from your error message.
Which confirms: You need to filter for something so that the retrieve returns data. You cannot just use the entire data extension.
==
2:
you could also just use Platform.Function.LookupRows if you already do everything else with Platform functions. I find it way simpler to write, and it works just with names of DEs, no need to "init", compose filters etc.
Server-side JavaScript - how lookup rows in data extension in Marketing cloud
Nice side effect:
Saves you the performance-heavy loading of the "core" platform ( you can omit Platform.Load("core", "1.1.1");
) as you no longer need anything from that library.
==
- if you need more than 2500 rows, the whole approach is flawed. There is an easier trick: Mark all records with a flag via upsert, then just run the deleteData function without for loops and lookups. See here:
Remove All Records with the Same email Domain in Suppresion list