SOLVED

Velocity Token - Account based CO

Go to solution
Travis_Schwartz
Level 4

Re: Velocity Token - Account based CO

oh, duh. 

 

yep. it works like a charm. 

 

Is it possible to format the date out of the ISO standard? I read your post https://blog.teknkl.com/velocity-days-and-weeks/ but did not see what I was looking to do.

 

I would love for something to go from: 2020-04-15 to display as April 15, 2020 as that would be a the way most people would write it.  is this doable. or does that require significant code to implement?

 

 

SanfordWhiteman
Level 10 - Community Moderator

Re: Velocity Token - Account based CO


I would love for something to go from: 2020-04-15 to display as April 15, 2020 as that would be a the way most people would write it. 


Most American people, maybe. 🙂

 


is this doable. or does that require significant code to implement?


 Not significant code at all but pls open another thread for this topic.

Travis_Schwartz
Level 4

Re: Velocity Token - Account based CO

I will do that, one other thing on this thread. 

 

I'm trying to understand what happens when a field type changes. If I were to be doing something similar for other products, but wanted to use a field type that was an integer field type, would the integer have to be converted to a string (I just wanted ? if so, how would that fit in? or does this deserve a new thread as well?? it would still be part of the $account field type.

 

for example, say I want to rather have it look at something based off $account.productType (Integer), what would change in the code (other than substituting what was there already). looking around on other posts I had seen you post this to convert an integer to a string, but not sure how it would fit in:

#set( $anInteger = $convert.toInteger( $aString ) )

 

 

#foreach( $account in $account_cList )
#if( $account.productType.equals("9005") )
#set( $dueDate = $account.upcomingPaymentDate )
#break
#end
#end
${dueDate}

 

 

 

 

SanfordWhiteman
Level 10 - Community Moderator

Re: Velocity Token - Account based CO


If I were to be doing something similar for other products, but wanted to use a field type that was an integer field type, would the integer have to be converted to a string?

To compare an Integer with an Integer you don't need any conversion at all.  If $var1 and $var2 are Integers then $var1.equals($var2) works fine.

 

#set( $anInteger = $convert.toInteger( $aString ) )

That's converting a String to an Integer, as the name suggests.  (Or, more precisely, creating a new Integer from a String.)

Travis_Schwartz
Level 4

Re: Velocity Token - Account based CO

One more thing on this, say a member has multiple cards and different due dates. Is there a way to differentiate between the two in the script? I need the script to be able to identify the desired due date and not display the first one it comes across (if that makes sense).

 

The email is set to trigger when someones due date is 10 days out. is it possible for the code to identify which card this would be related to and display the due date for that card?

 

SanfordWhiteman
Level 10 - Community Moderator

Re: Velocity Token - Account based CO

The email is set to trigger when someones due date is 10 days out. is it possible for the code to identify which card this would be related to and display the due date for that card?


I think you're sending from a batch still, not actually a trigger campaign, correct?

 

You can look through the list and find all the items whose date is 10 days ago, yes. Convert to Dates and Calendars, run a little date math.

 

But note that if you have more than 1  that was 10 days ago, they're both going to fit into that window. If the granularity is just a full day then there's no other way to decide among them. This may not be a problem, just pointing it out.

Travis_Schwartz
Level 4

Re: Velocity Token - Account based CO

I have it setup to where if they meet the criteria of having the loan type, that it requests the campaign, and the trigger is campaign requested, and in the flow it is wait 10 days till the due date, and send the email. I set this up following a template that was setup prior to my time here so there may be a better was of accomplishing this.

SanfordWhiteman
Level 10 - Community Moderator

Re: Velocity Token - Account based CO

I have it setup to where if they meet the criteria of having the loan type, that it requests the campaign, and the trigger is campaign requested, and in the flow it is wait 10 days till the due date, and send the email. I set this up following a template that was setup prior to my time here so there may be a better was of accomplishing this.


That's effectively a batch, then.

 

If you were to actually trigger on the CO being added, and have a Wait step directly in that flow, then you would have the special object $TriggerObject which automatically references the object in the list that caused the trigger to fire.

Travis_Schwartz
Level 4

Re: Velocity Token - Account based CO

You're correct. I got caught up in terminology. out company uses "batch" as emails that are not automated, but I have it set up as a batch that goes out daily and is still automated.