2

I am following Eliot Harper's answer on this thread.

His code in "Delete All Records" works fine for me, but his code from "Delete Single Record" results in a 500.

I included snippets from his answer below for reference

(500 Error) Delete Single Record

<script runat="server">
   var deleteRow = Platform.Function.DeleteData('AutoSuppressionExternalKey',['Email Address'],['[email protected]']);
</script>

(Works Fine) Delete All Records

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

var prox = new Script.Util.WSProxy();
var res;
var autoSupListDE = 'AutoSuppressionExternalKey'

function clearAutoSuppressionList(){
    var action = 'ClearData';
    var options = {};
    var props = {
        CustomerKey:autoSupListDE
    };
    var res = prox.performItem("DataExtension",props,action,options);
}

function main(){
  clearAutoSuppressionList();
}

main();
</script>

It seems to be working fine for other people, so I am not sure what is going on.

Note: I cannot comment on the original thread because I don't have enough reputation.

4
  • Can you share the actual piece of script you wrote with all your parameters?
    – zuzannamj
    Commented Feb 27, 2020 at 5:35
  • That's odd. Note, auto suppression lists are effectively Data Extensions, so you can interact with them in the same way. I definitely tested this code when I answered and it follows the documentation. Please can you wrap a JavaScript try/catch statement around your code and let me know what the error is? Commented Feb 27, 2020 at 6:51
  • 1
    This may be a silly guess..... but I faced something similar to this...... can you try the NAME of the DataExtension... instead of the EXTERNAL KEY Commented Feb 27, 2020 at 14:23
  • @EliotHarper I am using cloud pages, so I cannot Write the exception or store as AMPScript variable and output. But I did try VishalKumarCV's suggestion to use the DataExtension's name instead of External Key and it worked-go figure! Thanks for sharing. I will add an answer to my own question. Commented Feb 27, 2020 at 16:12

1 Answer 1

1

I took @VishalKumarCV's suggestion and used the list Name instead of the AutoSuppressionExternalKey and it worked!

You must log in to answer this question.

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