How can I keep velocity script formatting without remapping every time?

mkmarketo1
Level 2

How can I keep velocity script formatting without remapping every time?

We are building out velocity scripts in excel and need to copy them into velocity script within Marketo. When copying from excel to marketo, we need to remap everything my dragging the fields for it to work. Is there a way to keep velocity script mapping/formatting when copying from another source? 

5 REPLIES 5
Jo_Pitts1
Level 10 - Community Advisor

Re: How can I keep velocity script formatting without remapping every time?

@mkmarketo1 ,

let's step back for a moment. 

  1. Why are you coding Velocity in Excel?  How does that confer any benefit over coding in Marketo directly?
  2. What do you mean by 'remapping'?  Are you meaning field names?

Regards

Jo

SanfordWhiteman
Level 10 - Community Moderator

Re: How can I keep velocity script formatting without remapping every time?

Like Jo, I’m not sure how “building Velocity scripts in Excel” would be part of your workflow.

 

But merely copying and pasting new code into an existing Velocity {{my.token}} does not require re-checking the fields in the Script Editor tree. This simply is not a thing!

mkmarketo1
Level 2

Re: How can I keep velocity script formatting without remapping every time?

We use excel since we are writing 100+ if/then statements which can be automated via excel. 

 

Every time I paste into velocity, I have to drag the fields from the right side into my script for it to work. 

Jo_Pitts1
Level 10 - Community Advisor

Re: How can I keep velocity script formatting without remapping every time?

@mkmarketo1 ,

OK, so your real question here is 'how can I create a token and not have to select the Marketo fields I want to have accessible to my token from the list of fields on the right hand side'. 

 

Sadly (to the best of my knowledge) there is no way around this.

 

now for MY question :).. Why on earth do you have 100+ if/then statements?  Maybe a different approach to the script is called for?

 

Cheers

Jo

SanfordWhiteman
Level 10 - Community Moderator

Re: How can I keep velocity script formatting without remapping every time?

You’re gonna have to show us the code that’s being generated by Excel. 100 conditions may be done a far better way.

 

And still — updating a Velocity token (not creating a new token) doesn’t require re-checking the fields, that would break every Marketo instance if it did!