0

I am trying to use the LookUpRows function to display specific attributes associated with the 2 members in my Data Extension.

The attributes are MEMBER_NAME, MEMBER_NUMBER, CUSTOMER_TYPE & PLAN_TYPE

I'm written some AMPscript that doesn't throw me an error. However I can't display the attributes in my email so something must be wrong in my code.

Any guidance is appreciated!

Lookup Data Extension

MEMBER_NAME MEMBER_NUMBER EMAIL CUSTOMER_TYPE PLAN_TYPE
John 123 [email protected] High Type 1
Doe 456 [email protected] Low Type 2

AMPSCRIPT

set @lookupPlan = LookUpRows("My_DE","MEMBER_NAME",1)

set @countMember1 = rowcount(@lookupPlan)

IF @countMember1 > 0 THEN

    set @member1name = Field(Row(@LookupPlan,1),"MEMBER_NAME")
    set @member1number = Field(Row(@LookupPlan,1),"MEMBER_NUMBER")
    set @member1customer = Field(Row(@LookupPlan,1),"CUSTOMER_TYPE")
    set @member1plan = Field(Row(@LookupPlan,1),"PLAN_TYPE")

ENDIF

]%%

HTML

%%=v(@member1name)=%%
%%=v(@member1number)=%%
%%=v(@member1customer)=%%
%%=v(@member1plan)=%%
5

1 Answer 1

1

Your lookuprows in currently searching for records where member_name = 1, I’m sure that’s not what you want it to do. I assume you want to be able to search by the plan type. If yes, try something like this:

set @lookupPlan = LookUpRows("My_DE","PLAN_TYPE","Type 1")
2
  • Thanks this does work. However, I would like to look for all records, without having to search by plan type, name, or customer type May 4, 2023 at 16:20
  • Then you’d need to add a new column to your DE and have the name value for all records, eg. column called lookup and value 1 for all records and then in your script do set @lookupPlan = LookUpRows("My_DE","lookup","1")
    – zuzannamj
    May 4, 2023 at 16:22

You must log in to answer this question.

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