We created a landing page in Web Studio and placed a Smart Capture form on it with different fields, including an email address field which is mandatory and is also the Primary Key in the targeted data extension. Now, the form works only the first time. After we try to fill out the form for the second time, it does not validate nor does it update the target data extension. The ultimate goal is to send an email to a list segment asking them to give us more information about themselves, beside the email address they had already provided during sign up process.
-
are you need to update the data based on email address ?.– Ravi.AApr 25, 2019 at 14:24
-
Yes. I was informed by SF Support that an email addres can be validated only once in a form, so I guess I m looking for a workaround.– nix9247Apr 25, 2019 at 18:01
-
1can you please post your code here ?– Ravi.AApr 26, 2019 at 5:55
-
Smart Capture does not support update to a data extension. Have you tried tried DEManager or the UpsertDE function?– Kyle SzaboApr 27, 2019 at 4:25
-
You mean UpsertDE within the SmartCapture form?– nix9247May 3, 2019 at 9:19
1 Answer
Smart Capture indeed does not support Update / Upsert. Without Smart capture (but a custom coded form / handler setup), UpsertDE() AMPScript function is a simple workaround.
If Smart Capture is indeed a requirement, then UpsertDE function won't help because there is no possibility for a handler page with Smart Capture. In this case, you have to work with other types of "handler" processing - sql or journey builder:
1) Smart capture does only inserts. In any case you have to remove the Primary Key in your data extension. This will enable the form to insert duplicates into the DE.
2) Perform your duplicate check using Journey Builder or asynchronously via SQL.
2a) my recommendation is SQL. Each data extension record has a hidden field _CreatedDate and a hidden field _CustomObjectKey which you can employ in Queries to e.g. find the oldest entry, or the newest entry for a given email address. The downside is that the automation with the SQL runs hourly, but I would trade this latency of up to 60 mins for clean data in many many cases (Exceptions apply where the end customer expects immediate feedback such as Double Opt In.)
2b) Journey Builder: You can try your luck with Journey Builder. Ensure that the Smart Capture form has the "use in Journey Builder" box checked. Then in Journey Builder use the Entry Source "Smart Capture" referencing your form, and use decision splits to find the right data. It works in near real time, but for complex logics, I would always prefer SQL.