Pulling data from 40 days in future Velocity Token from Custom Object | Community
Skip to main content
New Participant
August 24, 2022
Question

Pulling data from 40 days in future Velocity Token from Custom Object

  • August 24, 2022
  • 1 reply
  • 1701 views

Hi,

 

I'm getting blank values from a velocity token that I wrote last year and it was working fine at that point in time however now it's just giving me blank data. The logic is we need to look for the value from a custom object list where fixedRateExpiryDate which is a future date matches 40 days from now and the value which we need is maskedBBAN if the status is active. I don't know if there's an update from Marketo which caused this issue however it was indeed working fine. Would appreciate any help. @sanfordwhiteman 

#set( $defaultTimeZone = $date.getTimeZone().getTimeZone("Pacific/Auckland") ) #set( $defaultLocale = $date.getLocale() ) #set( $calNow = $date.getCalendar() ) #set( $ret = $calNow.setTimeZone($defaultTimeZone) ) #set( $calConst = $field.in($calNow) ) #set( $ISO8601DateOnly = "yyyy-MM-dd" ) #set( $ISO8601DateTime = "yyyy-MM-dd'T'HH:mm:ss" ) #set( $ISO8601DateTimeWithSpace = "yyyy-MM-dd HH:mm:ss" ) #set( $ISO8601DateTimeWithMillisUTC = "yyyy-MM-dd'T'HH:mm:ss.SSS'Z'" ) #set( $ISO8601DateTimeWithMillisTZ = "yyyy-MM-dd'T'HH:mm:ss.SSSZ" ) #set( $fixedRateItems = [] ) #foreach( $item in $customerProductsONLY_cList ) #if( $item.accountStatus.equals("Active") && $item.fixedRateExpiryDate && $item.maskedBBAN) #set( $void = $fixedRateItems.add($item.maskedBBAN) ) #set ($maskredBBANFormat = $item.maskedBBAN) #set( $ret = $calNow.set( $calNow.get($calConst.YEAR), $calNow.get($calConst.MONTH), $calNow.get($calConst.DAY_OF_MONTH), 0, 0, 0 ) ) #set( $ret = $calNow.set($calConst.MILLISECOND,0) ) #set( $nextExpiryDate = $convert.toCalendar( $convert.parseDate( $item.fixedRateExpiryDate, $ISO8601DateOnly, $defaultLocale, $defaultTimeZone ) ) ) #set( $daystoexpire =$date.difference($calNow,$nextExpiryDate).getDays()) ##change number of days below #if($daystoexpire == 40) <li>$maskredBBANFormat##</li> #else #end #end #end

 

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
August 24, 2022

Please also supply the raw output of

${customerProductsONLY_cList}

for a relevant lead.

New Participant
August 24, 2022

 

Thanks for the reply @sanfordwhiteman I'm getting the value if i include the list. Luckily in the lead, there was only one active case but in others, we might have a list of multiple entries and we only need 1 from the list which matches the logic.

SanfordWhiteman
New Participant
August 24, 2022

Thanks for the reply @sanfordwhiteman I'm getting the value if i include the list. Luckily in the lead, there was only one active case but in others, we might have a list of multiple entries and we only need 1 from the list which matches the logic.


Don’t understand what you mean by “... if I include the list.”

 

Need to see an example of a person for whom the code is giving unexpected results. And the raw contents of the CO list for that person.