Velocity - Duplicate Criteria | Community
Skip to main content
Travis_Schwartz
New Participant
March 14, 2020
Question

Velocity - Duplicate Criteria

  • March 14, 2020
  • 1 reply
  • 3734 views

I'm working on a project for members who use our HELOC product. the issue I'm having is the information I need to write from is coming from a custom object and not from the lead record.

 

What I need to solve for is the following:

I exported the list for the credit limit:

${account_cList}

and previewed using a member who had this CO and that returned the values of:

[{creditLimit=null}, {creditLimit=null}, {creditLimit=null}, {creditLimit=2000}, {creditLimit=20000}]

The problem is I need the creditLimit value that is 20000, but I don't know how to identify which creditLimit value for the token to look at... and to (potentially) add complexity, I need to account for two different products:

{description=HELOC 80%}, {description=HELOC 70%}

and so once I get that, I need to take their limit and subtract the value of the balance to give me the difference, and identify which of the balances are associated with the correct HELOC product above.

 

This is what I tried with no luck (I know it's way off... I just don't know what to do to get it on track):

#foreach( $list in $account_cList ) #if( $list.listID.equals("creditLimit") ) #elseif($list.listID.equals("HELOC 70%, HELOC 80%") ) #set( $targetList = $list ) #break #end #end $math.div($list, "$list.listID.equals(HELOC 70%, HELOC 80%")) ${display.alt($targetList.creditLimit,"No matching list found.")}

 

Thanks.

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.

1 reply

SanfordWhiteman
New Participant
March 14, 2020

Yeah, that code basically makes no sense... but you knew that. 😶

 

Let's go over the logic again. Try not to guess about the code implementation, explain the business requirement in plain (though technical) English.

 

Each entry in your account_cList has 2 properties of interest:

 

  • $creditLimit, a nullable Integer
  • $description, a String that happens to be consistently (I hope) formatted as a space-delimited list of 2 subitems:
    • the first subitem is a product (String); after parsing, let's store that as $product
    • the second subitem is a percentage (numeric String + the "%" sign); after parsing and converting it to a Decimal, that's the $percentage

Correct?

 

You mention a "balance" but do not explain how that is stored.

 

Now explain exactly how the logic works with the list of objects and their properties.

Travis_Schwartz
New Participant
March 16, 2020

Yes, those are the two areas of interest.

$creditLimit is your favorite, currency... (I know, I'm still working on a plan to transition them. trying to find a solution that doesn't disrupt current campaigns.)

$description is a string. I'm not sure how it is. I don't see that under admin. Any advice on where to check on this? My concern is that they are not subitems, but I don't know for sure.

 

balance is also a currency field.

 

Assuming (I'll confirm) that they are formatted as 2 subitems, I think what we are wanting is for each entry in the account_cList, if $product = heloc and $percentage = 70% or 80%, then we use the math function to divide the value in $creditLimit but the value in the balance field.

We then take that value and display it as currency with $number.currency and adjust the stringlength to insert the comma.

Did I run off the rails again?

 

 

SanfordWhiteman
New Participant
March 16, 2020

Where is $balance stored? CO property or Lead property?

 


$description is a string. I'm not sure how it is. I don't see that under admin. Any advice on where to check on this? My concern is that they are not subitems, but I don't know for sure.


If it's a String, Marketo will not constrain the contents (there's no such thing as a "String that must contain 2 space-delimited substrings and the second one ends with the '%' sign") so your app is responsible for the contents.

 

You actually didn't describe the requirement clearly yet...

 


then we use the math function to divide the value in $creditLimit but the value in the balance field.

... how do the $percentage, $creditLimit, and $balance relate mathematically?

Also, can you try to use Courier for any inline code references like I do?