Re: Can I create a custom field that is a substring of another field?

Anonymous
Not applicable

Can I create a custom field that is a substring of another field?

I'm interested in doing this without scripting, but I can't find a way using formulas.

GOAL: WITHOUT SCRIPTING, I'd like to use a portion of an existing field as a query string in an email link (in our case, OrderID). This OrderID already exists within the text of another field we DO already capture (the OrderURL). In short, I'd like the link to look like this:

www.blah.com/target-page?id-to-send=123456 (or www.blah.com/target-page?id-to-send={{lead.OrderID}})

Where OrderURL (an existing field) = v123456.abcdef.aaabbcc.com

And OrderID (not currently its own field) = 123456

QUESTION: Is there a way to accomplish any of the following?

  1. Create a custom field in Marketo whose value is a portion of another field (a substring function) without scripting

  2. Create the link such that the substring action is performed on the existing field (the OrderURL) within the link itself at the point of render/send (rather than having to create a persistent field)

  3. Accomplish my goal in some other way I haven't considered

Did I mention that I don't want to use scripting to accomplish this? Thanks for any guidance!

10 REPLIES 10
Jim_Thao7
Level 9

Re: Can I create a custom field that is a substring of another field?

Short answer, no. 

Marketo currently doesn't do math in any way that I know of: which includes addition, subtraction, multiplication, division of strings, numbers, etc.

SanfordWhiteman
Level 10 - Community Moderator

Re: Can I create a custom field that is a substring of another field?

Your requirement of "at the point of render/send" mandates that you use an email script. That's what -- and where -- scripts are for.

Anonymous
Not applicable

Re: Can I create a custom field that is a substring of another field?

That's not a requirement...just one way I could think to solve the problem (for example, another way was listed in option #1).

SanfordWhiteman
Level 10 - Community Moderator

Re: Can I create a custom field that is a substring of another field?

The answer is still no, if you're averse to all kinds of scripting.

A FlowBoost script could do this in one line, then save the value in another persistent lead field. But I would never choose a FlowBoost script over a Velocity script for this case.

Anonymous
Not applicable

Re: Can I create a custom field that is a substring of another field?

I had no idea how easy scripting would be; I'm up and running with a scripted solution (to which I was 110% opposed). Problem solved...thanks!

SanfordWhiteman
Level 10 - Community Moderator

Re: Can I create a custom field that is a substring of another field?

OK, great.  Yes, Velocity packs a lot of power even in a couple of lines, and with more code you can do some mind-blowing customization. If you get ambitious, you can learn more via my posts at http://blog.teknkl.com/tag/velocity.

SanfordWhiteman
Level 10 - Community Moderator

Re: Can I create a custom field that is a substring of another field?

Curious about the Velocity (VTL) code you ended up using for this. Have you checked to see that the link is tracked?

nandoZ
Level 1

Re: Can I create a custom field that is a substring of another field?

Im not super familiar with scripts, what would this look like? I am trying to do what OP did

SanfordWhiteman
Level 10 - Community Moderator

Re: Can I create a custom field that is a substring of another field?

As this thread is 6 years old, please open a new one and describe your requirements.