0

I am having issue with the script below. I have a DE that includes a column "Days Since Last Login". I want specific language to display based upon what the numeric value is in that column on each row. Currently, it just puts all of the possible options into one large paragraph. Any help is appreciated.

%%[var @DSLL set @DSLL = [Days Since Last Login]]%%

%%[[If @DSLL < '61' Then]%%
Thanks for using our platform, we hope you are finding it to be an invaluable tool in patient care! 

%%[ElseIf @DSLL > '60' AND @DSLL < '90' Then]%%
You haven’t logged in in almost 3 months! Log in today to avoid your access being suspended.

%%[ElseIf @DSLL > '399' Then]%% 
You’re missing out on some of the great things we added last year, like the ability to see if your patient has had any referrals made to help them with social determinants of help—and the capability to make a referral yourself, if needed! 

%%[Else]%%
You’re missing out on the enhancements we have continually been making to our patient record snapshot. Log in today to see why providers are saying this view of patient records has become an invaluable tool in patient care.

%%[EndIf]]%%

1 Answer 1

1

Take out the numbers from the apostrophes and get rid if the unnecessary square brackets:

%%[set @DSLL = "Days Since Last Login"]%%

%%[If @DSLL < 61 Then]%%
Thanks for using our platform, we hope you are finding it to be an invaluable tool in patient care! 

%%[ElseIf @DSLL > 60 AND @DSLL < 90 Then]%%
You haven’t logged in in almost 3 months! Log in today to avoid your access being suspended.

%%[ElseIf @DSLL > 399 Then]%% 
You’re missing out on some of the great things we added last year, like the ability to see if your patient has had any referrals made to help them with social determinants of help—and the capability to make a referral yourself, if needed! 

%%[Else]%%
You’re missing out on the enhancements we have continually been making to our patient record snapshot. Log in today to see why providers are saying this view of patient records has become an invaluable tool in patient care.

%%[EndIf]%%
1
  • 1
    This is the right way to go, but worth noting is that it assumes the numbers being evaluated are numbers, and not strings/text. OP is evaluating texted numbers - which is why it is failing. If the values in [Days Since Last Login] are strings, but need to be numbers, I'd nest the variable assignment into a Format() function to make sure it treats the value at @DSLL as a number. Commented Jan 23, 2023 at 17:38

You must log in to answer this question.

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