0

I am using two data extensions, with a primary key in both as Id, first data extension contacts fields as name, email, brand, id. second one contains id, brand, delivers. One name can have more than one delivers. So how to print that? I am getting only one delivers output.

%%[
 VAR @Id,@Delivers
]%%

Hi %%Name%% <br>

Thanks for showing your interest in our Brand.<br>

Brand = %%Brand%%<br>

The brand you have showed interest in will help you to serve in the below area:
<br/>

%%[

 SET @Id = AttributeValue("Id")
 SET @Delivers = Lookup('Brandonetomany','Delivers','Id', @Id)

]%%

%%=v(@Delivers)=%% <br>
0

this should get you started:

%%[
VAR @myrowset,
@rowCount,
@row,
@i,
@delivery
SET @id = Lookup("myFirstDE","id","id",_subscriberkey)
/*return from myFirstDE the field id, where id == _subscriberkey"*/

SET @myrowset = LookupRows("mysecondDE","Id",@id)
SET @rowCount = rowcount(@myrowset)

IF @rowCount > 0 THEN

FOR @i = 1 TO @rowCount DO

    SET @row = row(@myrowset,@i) /*get row based on loop counter */
    SET @delivery = field(@row,"delivery")
]%%
Deliverynumber and value : %%v=(@i)=%%, %%=v(@delivery)=%% <br>
%%[

NEXT @i

ENDIF
]%% 
| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.