0

I have created a smartcapture form in a cluoudpage which includes a picklist field that contains a set of values (e.g. product names).

From the moment the user submits the form, I need to store in the target data extension the product name (this is done OOTB) and the product code related to the value selected in the picklist.

For the product code. it is stored in a different data extension that includes the relation between the product name and the code, so I just need to find a way to populate the corresponding product code in the target data extension from the moment the form is submitted. Could it be achieved by using AMPScript or in a different way?

2
  • Do you need it in real time? If not, you could use SQL Query Activity to update the field in question. If real time is a requirement, you will need to build a custom solution, as it can't be achieved with Smart Capture. Jun 5, 2023 at 16:07
  • It would be ideal to have it real time yes. That custom solution will include SSJS or other approach?
    – fromero
    Jun 6, 2023 at 10:58

1 Answer 1

1

I don't think you can use AMPscript to populate the product code (storing in a different DE) based on a product the customer will select in the Smart Capture form due to this activity comes from the client side while AMPscript is serverside and you can only interact with it on the server side.

I would recommend using an additional step to process the data. In this case, you can use SQL query to populate the corresponding product code to a new data extension.

I put a sample code for this:

SELECT
a.Product,
b.ProducCode
FROM
[Your target DE] as a
INNER JOIN
[Your lookup DE] as b
ON
a.Product = b.Product
4
  • Thanks for your comment, although I find it really useful, I think it doesn't cover my need. I have edited the description to make it more clear.
    – fromero
    Jun 5, 2023 at 13:36
  • @fromero I have updated my answer.
    – Duc Le
    Jun 5, 2023 at 15:10
  • Hello, this is exactly my plan B, if I cannot make it happen in real-time with the submission. Thanks for your help!
    – fromero
    Jun 5, 2023 at 15:14
  • If you use a Custom form, you can use AMPScript to handle the submission and can run your post-processing logic. However, server-side processing may cause a delay in form submission. Jul 23, 2023 at 3:12

You must log in to answer this question.

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