enter image description hereI would like to update a custom salesforce object when a marketing cloud email is sent. I have a transaction object and once the email is sent, I would like to update the description field to “Acknowledged”.

To use ampscript code UpdateSingleSalesforceObject I need the transaction Id in my data extension however I already have the contact ID (for email sending) in my data extension so I’m stuck on how to pull in a second ID in the query.

Is there a way to rename the transaction Id before pulling it into my data extensions?

I was also wondering do I need to create 2 separate data extensions in Contact builder? I have never used Contact builder so I’m not sure how I would link the data extensions together.

Will this even work putting the below code at the beginning of an email? %%[ var @result set @result = UpdateSingleSalesforceObject(‘AQB__Transaction__c’,’TransId’,’AQB__Description__c’,’Acknowledged’) ]%%

Appreciate any guidance, I'm getting above my skill set but I really want this to work.

1 Answer 1


If you have a lookup between these two objects Contacts and Transaction. You can create the sendable data extension using query activity and pull the transaction ids along with the contact ids in a separate column. Once you have the transaction ids in your sendable data extension, you can perform the above UpdateSingleSalesforceObject in your email.

  • thank you so much for your assistance. I do have a lookup and when i try to pull the transaction Id in, it tells me I have already pulled in an Id column. I have a screenshot of the error and will try to figure out where to upload it so you can see it.
    – user47606
    Sep 11, 2018 at 14:57
  • code works fine until I add line #4.
    – user47606
    Sep 11, 2018 at 14:59
  • Thank you so much you got me pushed in the right direction. I found that i could rename the ID field by using AS after it. This worked. Select ATransCont.AQB__Amount__c, ATransCont.AQB__Date__c, ATransCont.Designation_Name__c, ATransCont.Id as TransId, AContacts.FirstName, AContacts.Email, AContacts.Id, Accounts.DRM_Email__c From ATransCont Inner Join AContacts on ATransCont.AQB__Account__c=AContacts.AccountId Inner Join Accounts on AContacts.AccountId = Accounts.Id
    – user47606
    Sep 11, 2018 at 19:10

You must log in to answer this question.

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