0

I am trying to update a boolean column (new) using the following SSJS:

        var targetDE = DataExtension.Init(DE);
        var processing = targetDE.Rows.Update(
            {
                attempts: 0,
                status: "static line here",
                new: false,
                code:null,
                description:null
            },
            ['subscriberkey'], [key]
        );

When I run this code in a cloudpage, it returns a 500 error. As soon as I remove the new: false line it works again. I have tried also using 'false' and 0 but neither of these values work.

1 Answer 1

3

new is a reserved word/operator for JavaScript which is what is causing the miscommunication and error in your code. If you change your keys to be quoted, it should work as expected.

e.g.

        var targetDE = DataExtension.Init(DE);
        var processing = targetDE.Rows.Update(
            {
                "attempts": 0,
                "status": "static line here",
                "new": false,
                "code":null,
                "description":null
            },
            ['subscriberkey'], [key]
        );

You must log in to answer this question.

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