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
    Did you add the ent. prefix to the Data Extension name? – zuzannamj May 15 at 6:45
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

| improve this answer | |
  • Yes I am using "ENT." LookupRows function is working and fetching data as per expectation but UpdateData function is not working for me. – Ganesh Ekhande May 17 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 May 17 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 May 17 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. – Ganesh Ekhande May 18 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.

| improve this answer | |

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.