0

The intent is to update the TargetUpdateType property of a QueryDefinition object using SSJS. (reference)

The following SSJS is outputting an error response to the QueryDefinition.Update() function:

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

    var QD_TestAudienceSend_ExternalKey = "qd-testaudiencesend"; 

    var qd = QueryDefinition.Init(QD_TestAudienceSend_ExternalKey);
    var update_status = qd.Update({TargetUpdateType: "update"});

</script>

update_status: <ctrl:var name=update_status />

Code referenced.

Any ideas what I'm doing wrong?

1

Your code is fine, However SSJS is a case-sensitive language so only change you have to do to pass TargetUpdateType in ProperCase format.

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

    var QD_TestAudienceSend_ExternalKey = "qd-testaudiencesend"; 
    var qd = QueryDefinition.Init(QD_TestAudienceSend_ExternalKey);
    var update_status = qd.Update({TargetUpdateType: "Update"});
</script>


update_status: <ctrl:var name=update_status />

Output: update_status: OK

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.