We have a html form and from this form we fetch email address.

For example, the form input field looks like this,

<input type="text" name="EmailAddress">

Then there is the amp-script code to fetch information from the form on submit

set @EmailAddress = Replace(RequestParameter("EmailAddress")," ","+") 

if empty(@EmailAddress) then set @EmailAddress = Replace(RequestParameter("email")," ","+") endif

This is built by someone in our team in the past and I am trying to understand what exactly the ampScript does here with replace? I am totally not able to understand this part. I only know that EmailAddress Filed is being fetched form input. Please can anyone help me understand this . Thanks

  • before asking on the forum, I would suggest you take a look at available resources that you can find either on trailhead , or the documentation
    – glls
    Sep 21, 2021 at 18:50

1 Answer 1


Take a look at Replace and RequestParameter functions. There are more available sources that could be easily found to get started with AMPscript.

In your case, your code translates to:

  1. Request parameter "EmailAddress" and then replace any spaces there with the "+" symbol.
  2. If it is empty, then do the same but to the "email" parameter.

You must log in to answer this question.

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