0

Seems like a simple request but I can’t figure this out. Using Smart Capture forms, I’d like to update or add new records to a data extension. Adding new records works as expected, but if the record exists, the form will not submit.

I know this is possible using Web Collect and DEManager but I’d like to get this working with Smart Capture to be built using drag-and-drop components. I’ve tried adding hidden fields with no luck.

Salesforce documentation states this is possible but it’s not very clear how to configure. Any help is appreciated, thank you!

https://help.salesforce.com/articleView?id=mc_es_smart_capture_form_actions.htm&type=5

https://help.salesforce.com/articleView?id=mc_es_input_parameters_for_upsert_to_data_extension.htm&type=5

1

I don't think this is possible as Smart Capture forms seem to be "insert" only.

This leads to the behavior that the form in your case does not submit due to a primary Key Violation (inserting the same key twice is not allowed).

A workaround to keep the drag-and-drop functionality can be to remove all Primary Keys from the data extension behind the form. Basically, keep this data extension as "dumb" as possible in terms of validation to accept all kinds of user input.

For each record inserted, populate a date field ("timestamp") with a default value of "now" (getdate() ) to discern the latest entry and use backend processing via e.g. SQL to create a "clean" data extension without duplicates, by e.g. keeping the newest entry.

Then use the cleaned up DE for any further processes.

To address your followup questions:

Can SSJS/AMPscript be used to display a message on the page that a record already exists and has been updated?

Yes.

Send the user to the page using CloudpagesUrl AMPScript function: This establishes the "user context" on the cloudpage, meaning that the personalization string %%_subscriberkey%% will resolve to the user's subscriber key. From this you can basically get all the user's data.

AMPscript can be used to perform a Lookup into your Data extension and check if there is an existing record with e.g. the same subscriber Key or email. However, we are of course leaving point-and-click territory here ;)

Can the cleaned up de be used as the entry event into a journey?

Yes.

That is pretty much the idea. accept all data into a validation-less data extension. Validate in the backend and clean up your data. use the cleaned up DE as source for a Journey that e.g. sends validated Leads and Contacts to Salesforce.

Create the SQL query that performs the cleanup and save it in an automation.

Next, build your journey. Set the Journey to Entry source: Data extension. Select your cleaned up DE as that Data Extension.

Next, set as Entry Source Schedule: "Automation" Select your Automation built earlier. Finish building the Journey as you wish.

Once you activate your Journey, navigate to the automation referenced. You will see the activation placed a "diamond" style icon behind the last step of the automation, which represents the injection of its result into the Journey.

4
  • Thanks for the reply, Jonas! I have a couple questions.1. Can SSJS/AMPscfipt be used to display a message on the page that a record already exists and has been updated? 2. Can the cleaned up de be used as the entry event into a journey? Right now, records in the de behind the form are injected into the journey. Salesforce documentation makes it seem like an upsert is possible with Smart Capture by I can’t find any code samplea on any of the support pages or forums. Thanks again for your help, I’ll build the cleaned up de and comment back the results.
    – Kyle Szabo
    Feb 28 '19 at 13:11
  • @KyleSzabo edited my answer to address your followup questions Mar 1 '19 at 15:42
  • Thanks again for your help with this, I really appreciate it! Instead of using a scheduled automation as the entry source, is it possible to trigger the journey once the Smart Capture “dumb” form is submitted? Otherwise I can build an html form using Web Collect and DEManager that supports upsert.
    – Kyle Szabo
    Mar 1 '19 at 15:58
  • Unfortunately, this does not work together with the Smart Capture entry event, no. It is a bit of a tradeoff. When using the drag and drop functionality of Content Builder, I would rather have a slower but clean scheduled process than a direct interface with messy data, but if your usecase requires immediate AND clean data, you would better resort to custom code (JS / ampscript) and forget about Drag and Drop :) Mar 1 '19 at 16:01
1

I am seeing updated documentation where it says that "Upsert to Data Extension" is now available for Smart Capture.

This is done via Smart Capture Form Actions

Please see additional resources:

https://help.salesforce.com/articleView?id=mc_es_input_parameters_for_upsert_to_data_extension.htm&type=5

https://help.salesforce.com/articleView?id=mc_es_smart_capture_form_actions.htm&type=5

0

It seems like this is being solved in the june release https://help.salesforce.com/articleView?id=sf.mc_rn_june_2021_cp_smart_capture.htm&type=5

1
  • While this may theoretically answer the question, it would be preferable to include the essential parts of the answer here, and provide the link for reference.
    – identigral
    Jun 6 at 4:23

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.