Home / taxonomy / term / AMPScript / AMPScript / AMPScript


245 points
eamicucci's picture

I have a column in an data extension (FIRSTNAME) that is in all caps when it comes into our campaign management system. I need to format the personalization string I use in emails so that %%FIRSTNAME%% returns "Mary" instead of "MARY".


How can I make the first character constant and the rest lowercase. Obviously this returns all lowercase %%=LOWERCASE(FIRSTNAME)=%%. Any suggestions are much appreciated!

Formatting a personalization string with AMPSCRIPT

0 points
stokedbloke's picture

I want to check if a personalization attribute is empty before I output it, but I cannot get the Ampscript to work.


Here's my code:


%%[IF Length("Provider Rating") > 0) THEN]%% 

<tr><td width=100>Rating:</td>

<td width=400>%%Provider Rating%%</td></tr>



Is this because my attribute has a space in it?  If so, what should I do?  Here is the error:


Errors found in the email HTML Body.

Category : AMP Script

Ampscript %%IF%% statement woes...

120 points
flpdiaz's picture

Does anyone know if there is a way to create custom AMPScript Functions?

For example, I've created a simple function that outputs a URL, the domain and Return path come from the database:


SET @setterProtocol = "http://"
SET @getDomain = Domain_Name /* www.domain.com */
SET @getReturnPath = Return_Path /* ?code=1233&tst */

SET @URL2 = Concat(@setterProtocol,@getDomain,@getReturnPath)



I would like to create a custom function of the code above so that when I write it i can simple call it like this:


Custom AMPScript Functions?

665 points
JonnyTek's picture

We are creating a landing page which uses a URL post and AMPscript to add a record into an extension and also to trigger a send email. It seems like the triggered send script is partially duplicating records being inserted (adding two records on arrival instead of one). Is there anything in triggered send which should be doing this or is it specific in how the our triggered send is configured? If I could link to code I would but as it is a development project I can't really reveal the page or related code. Thank you.

UpsertData conflicting with Triggered Send

665 points
JonnyTek's picture

I think this is a more general coding question than specific to ET. We are creating a form intended to allow a person to register a product. They would have followed a link to get to the page and doing so POSTS and ID value on the page which is then set as a Variable using RequestParameter. They will add their email address to a field on the page.

After doing so, clicking a "Submit" button should (as in "we would like") post the SET ID value and Email address to the location specified in Action.

Posting from two elements.

665 points
JonnyTek's picture

We have 3 date fields on a form which CAN add dates into a data extension. The features works HOWEVER the fields are optional and can be left blank. If left blank instead of remaining NULL, the fields get a Value = 01/01/1900 (and I don't think ET can send email reminders that far back in time, don't even think it can travel back in time 2 minutes!). Nonetheless this looks sloppy. How can we force the field to remain NULL unless a value is specified?

Forcing a Date field to remain NULL.

665 points
JonnyTek's picture

The description in Help for Claim Rows is a little murkey to me. I get the basic idea that if a row is claimed it can't be edited until unclaimed. (correct?) So the claiming of the row, I'm guessing this happens when I call on a screen (page) used to edit the database record. When the record is submitted with any modifications I'd unclaim it. Couple of questions:

1. If I am correct about the usage of ClaimRow then confirm that I am correct and directly in the call for the edit screen I can include a function that claims the row to prevent editing.

Claim Rows, Can we clarify anything on this?