Adding Rows to Data Extensions

Data Extensions in the Salesforce Marketing Cloud platform are simply database tables in which you can store data you need for your campaigns.

You can add rows to data extensions using:

With the API, you have a few options — SOAP being the most complex, AMPscript the simplest:

You can use AMPscript in emails, landing pages or SMS keyword configurations. I’ll use AMPscript in this example.

Here’s how you add or update a single row in a data extension named My_Test_DataExtension using the UpsertDE() function:

Here’s a breakdown of the UpsertDE() arguments in this example:

  1. The name of the data extension to receive the data
  2. Number of columns you’re using to check to see if there’s a matching row already in the data extension. (This means there will be only 1 pair of name and value arguments following this parameter. ¬†You could specify more.)
  3. The lookup column
  4. The lookup value
  5. Column 1 to update
  6. Column 1 update value
  7. Column 2 to update
  8. Column 2 update value

For further reading:
AMPscript Functions
UpsertData() (for SMS keywords)
UpdateData() (for SMS keywords)

(Visited 2,628 times, 1 visits today)
Notify of
Inline Feedbacks
View all comments