0

I have Data Extension in Child Business Unit which has been shared with Parent Business Unit. This Data Extension has 3 Primary Keys SubScriberKey, JobId, EventDate. It also has a "Processed" flag which is set to False by default on each record.

I have created automation with a SSJS Activity in Parent BU to process records and then update back Processed flag to True on the successfully processed records.

I am using UpdateData AMPScript function to update Data Extension rows.

Following is the code from the Cloud Page where I am trying to update Data Extension rows.

set @resultMC = UpdateData(@deName,3,'SubscriberKey',@subscriberKey,'JobId',@JobId,'EventDate',@activityDate,'Processed',1) 

My Automation is processing records without any error but not updating Processed flag on the Data Extension. Am I missing anything here? Does UpdateData function even work for Shared Data Extension?

1
  • 1
    Did you add the ent. prefix to the Data Extension name?
    – zuzannamj
    Commented May 15, 2020 at 6:45

2 Answers 2

4

When coding AMPScript using a Shared Data Extension in an Enterprise 2.0 account, you add the prefix "ENT." to the data extension name.

Doc: https://help.salesforce.com/articleView?id=000320283&language=en_US&mode=1&sfdcIFrameOrigin=null&type=1

4
  • Yes I am using "ENT." LookupRows function is working and fetching data as per expectation but UpdateData function is not working for me. Commented May 17, 2020 at 21:35
  • OK, just to confirm - where are you running your AMPscript - on a CloudPage or in the Script Activity? Can you post the whole script for context?
    – zuzannamj
    Commented May 17, 2020 at 21:44
  • 1
    And yes, the UpdateData function works just fine with shared DEs, there must be a mix up with where and how you run your script
    – zuzannamj
    Commented May 17, 2020 at 21:53
  • I am running AMPScript on a CloudPage. Posting whole script would have helped to identify issue quicker. Will do next time. thanks. Commented May 18, 2020 at 0:27
0

Thanks for your inputs @zuzannamj. I figured it out. It was actually a logical error. I was formatting Event Date in order to push it to Salesforce custom object. And was using same formatted date in the UpdateData call. As formatted Event Date was not matching with any record in the data extension, it was running successfully but without updating any records. It makes sense. So using date prior to formatting in UpdateData function fixed an issue. Thanks.

You must log in to answer this question.

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