1

Hi I have a custom activity where in upon execute it will call a webservice. I'm good up to this point also I'm able to get the response, now the question is

Using the response that I received is it possible to update the row of a certain data extension?

Thank you.

This is a sample of my custom activity, activity.js

exports.execute = function (req, res) { //console.log("execute function!!!");

console.log("EXECUTE HAS BEEN RUN");
JWT(req.body, process.env.JWT_KEY, (err, decoded) => {

    // verification error -> unauthorized request
    if (err) {
        console.error(err);
        return res.status(401).end();
    }


    if (decoded && decoded.inArguments && decoded.inArguments.length > 0) {[]

    //Use fields in decoded.inarguments to create a request body
    //use node.js to do webservice
    var bodyStringAdvertising = JSON.stringify({
    //Sample body
    })

    var headersAdvertising = {
    //Sample header
    }

    var optionsAdvertising = { 
    method: 'POST',
    headers: headersAdvertising,
    url: '//Sample URL'
    };

    request(optionsAdvertising, function (error, response, body) {
    if (error) throw new Error(error);
    console.log('response body',body);

    //Once I get the response, I'm going to use some of the values to update 
    a row in a Data Extension
    //How Can I do that

    }).write(bodyStringAdvertising); 

    } else {
        console.error('inArguments invalid.');
        return res.status(400).end();
    }

});

console.log("end execute function!!!");

};

Thanks for any help.

2

It's possible, you have to use marketing cloud API you can use REST API or SOAP API it depends on you, ie REST API: https://developer.salesforce.com/docs/atlas.en-us.mc-apis.meta/mc-apis/postDataExtensionRowsetByKey.htm The same applies to SOAP API, you can find many examples in this page.

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.