Topic Options
#33969 - 11/17/10 12:10 PM putting variables within an expression
A Plus Letter Offline
OL Newbie

Registered: 04/10/08
Posts: 15
Loc: USA
I am making an expression and want to put in a data field within the expression, can this be done?

here is an example:IF([Cu_name3] = "AmeriCU PG2.pdf", "Simply present your AmeriCU MasterCard ending in [Last4] for five or more purchases of at least $25.00 each anywhere MasterCard is accepted, including:", IF([Cu_name3] = "City of Police FCU PG2.pdf", "Simply present your City & Police Federal Credit Union MasterCard ending in [Last4] for five or more purchases of at least $25.00 each anywhere MasterCard is accepted, including:", IF([Cu_name3] = "Firstmark CU PG2.pdf", "Simply present your Firstmark Credit Union MasterCard ending in [Last4] for five or more purchases of at least $25.00 each anywhere MasterCard is accepted, including:", IF([Cu_name3] = "Hope CU PG2.pdf", "Simply present your Hope Federal Credit Union MasterCard ending in [Last4] for five or more purchases of at least $25.00 each anywhere MasterCard is accepted, including:", IF([Cu_name3] = "Member One PG2.pdf", "Simply present your Member One MasterCard ending in [Last4] for fie or more purchases of at least $25.00 each anywhere MasterCard is accepted, including:", IF([Cu_name3] = "Metro CU PG2.pdf", "Simply present your Metro Credit Union MasterCard ending in [Last4] for five or more purchases of at least $25.00 each anywhere MasterCard is accepted, including:", IF([Cu_name3] = "People's Trust FCU PG2.pdf ", "Simply present your People’s Trust Federal Credit Union MasterCard ending in [Last4] for five or more purchases of at least $25.00 each anywhere MasterCard is accepted, including:", IF([Cu_name3] = "City & Police FCU Gold PG2,pdf", "Simply present your City & Police Federal Credit Union Gold MasterCard ending in [Last4] for five or more purchases of at least $25.00 each anywhere MasterCrd is accepted, including:", IF([Cu_name3] = "Consumers CU PG2.pdf", "Simply present your Consumers Credit Union Gold MasterCard ending in [Last4] for five or more purchases of at least $25.00 each anywhere MasterCard is accepted, including:", "")))))))))

the variable with in is the field [last4].

Top
#33970 - 11/17/10 01:01 PM Re: putting variables within an expression [Re: A Plus Letter]
Raphael Lalonde Lefebvre Online   content
OL Expert

Registered: 10/14/05
Posts: 4953
Loc: Objectif Lune Montreal
A Plus Letter,

Well, that sure is one HUGE example here! wink

But yes, it can be done. However, you need to concatenate them separately from the static string. For example, the way you've typed it:

"Simply present your Firstmark Credit Union MasterCard ending in [Last4] for five or more purchases of at least $25.00 each anywhere MasterCard is accepted, including:"

This will not work, since you put [Last4] inside the double quotes, and so it doesn't see it as a field, but rather as the word "[Last4]". The correct syntax would be:

"Simply present your Firstmark Credit Union MasterCard ending in " & [Last4] & " for five or more purchases of at least $25.00 each anywhere MasterCard is accepted, including:"

Notice how I've entered the [Last4] field. That's how it needs to be done.

Hope that helps!

Regards,
Raphaël Lalonde Lefebvre

Top
#33974 - 11/18/10 08:13 AM Re: putting variables within an expression [Re: Raphael Lalonde Lefebvre]
A Plus Letter Offline
OL Newbie

Registered: 04/10/08
Posts: 15
Loc: USA
Thank you for your help. We were pulling our hair out with the examples in the help on PSM but not getting any where. We ended up stumbling on it since the help section really did not explain it to well with a sentence with a mergefield in the middle of it. Your help is always appreciated. We are still learning all the various things that PSM can do for us.

Top