[SalesForce] Smart Capture Gear in Cloud Page

I am trying to create a Smart Capture form in a Cloud Page. I would like to populate a hidden field with the current date. Can you use Ampscript to do this?

Best Answer

You should be able to use the NOW( ) AMPScript function to achieve this. However, there is currently a known issue that doesn't allow you to simply use the %%=NOW()=%% in a hidden field's value. A workaround for this is to write your code without using an equal symbol.

For example, you would want to use something along the lines of the below. In your CloudPage, define the variable as such:

%%[
Var @date
Set @date = NOW()
]%%

Then in your hidden smart capture field, declare this variable like this:

%%[
Output(v(@date))
]%%

Further info on the NOW( ) Function can be found here: http://help.exacttarget.com/en/documentation/exacttarget/content/ampscript/ampscript_syntax_guide/datetime_ampscript_functions/#Now

Related Topic