Returns a rowset from a data extension where the field matches the specified value.
AMPSCRIPT BLOCK : LOOKUPROWS PRODUCTS WHERE GENDER='MEN'
%%[
SET @subscriberkey=_subscriberkey
SET @email=emailaddr
SET @season='Winter' /*Summer*/
SET @firstName='Shashi'
SET @lastName='Prasad'
SET @productId=1
SET @gender='men'
SET @rows=LookUpRows('PRODUCTS','GENDER',PROPERCASE(@gender))
]%%
%%=v(Concat('Hello ',@firstName,' ',@lastName,','))=%%
<p>We're writing to let you know that over the coming weeks,
we are launching new products</p>
<div><b>Product Details</b></div>
<div></div>
%%[IF RowCount(@rows) > 0 THEN]%%
%%[FOR @i=1 to RowCount(@rows) do
SET @row=ROW(@rows,@i)
]%%
<div>Product No : %%=v(@i)=%%</div>
<div><b>Name </b>: %%=v(UPPERCASE(FIELD(@row,'PRODUCTNAME')))=%%</div>
<div><b>Description</b> :
%%=v(PROPERCASE(FIELD(@row,'PRODUCTDESCRIPTION')))=%%</div>
<div><b>Price</b> :
%%=v(FORMATCURRENCY(FIELD(@row,'PRICE'),@productCurrency,3))=%%</div>
<div><b>Packaging Date </b>:
%%=v(FORMATDATE(FIELD(@row,'PACKAGINGDATE'),'MMM DD, YYYY'))=%%</div>
<div><b>In Stock </b>:%%=v(LOWERCASE(FIELD(@row,'INSTOCK')))=%%</div>
<div><b>Gender </b>:%%=v(TRIM(FIELD(@row,'GENDER')))=%%</div>
<div></div><br/>
%%[NEXT @i]%%
%%[ENDIF]%%
<div>
%%=v(Concat('No. of Products Available : ',RowCount(@rows)))=%%
</div>
AMPSCRIPT BLOCK : LOOKUPORDEREDROWS PRODUCTS WHERE GENDER='WOMEN' AND SEASON='WINTER'
%%[
SET @subscriberkey=_subscriberkey
SET @email=emailaddr
SET @season='winter' /*Summer*/
SET @firstName='Shashi'
SET @lastName='Prasad'
SET @productId=1
SET @gender='women'
SET @rows=LookUpRows('PRODUCTS',
'GENDER',PROPERCASE(@gender),
'SEASON',PROPERCASE(@season)
)
]%%
%%=v(Concat('Hello ',@firstName,' ',@lastName,','))=%%
<p>We're writing to let you know that over the coming weeks,
we are launching new products</p>
<div><b>Product Details</b></div>
<div></div>
%%[IF RowCount(@rows) > 0 THEN]%%
%%[FOR @i=1 to RowCount(@rows) do
SET @row=ROW(@rows,@i)
]%%
<div>Product No : %%=v(@i)=%%</div>
<div><b>Name </b>: %%=v(UPPERCASE(FIELD(@row,'PRODUCTNAME')))=%%</div>
<div><b>Description</b> :
%%=v(PROPERCASE(FIELD(@row,'PRODUCTDESCRIPTION')))=%%</div>
<div><b>Price</b> :
%%=v(FORMATCURRENCY(FIELD(@row,'PRICE'),@productCurrency,3))=%%</div>
<div><b>Packaging Date </b>:
%%=v(FORMATDATE(FIELD(@row,'PACKAGINGDATE'),'MMM DD, YYYY'))=%%</div>
<div><b>In Stock </b>:%%=v(LOWERCASE(FIELD(@row,'INSTOCK')))=%%</div>
<div><b>Gender </b>:%%=v(TRIM(FIELD(@row,'GENDER')))=%%</div>
<div></div><br/>
%%[NEXT @i ELSE]%%
<div>No products to display</div><br/>
%%[ENDIF]%%
<div>
%%=v(Concat('No. of Products Available : ',RowCount(@rows)))=%%
</div>
Comments
Post a Comment