we want to link to the self scheduler link if it’s populated and link to a default if it’s not. We also want to add a UTM query string to the end of the unique self scheduler link. Here is the logic I currently have:
the else is working but the if is not, any insight?
firstly, here's how to post code into Marketo nation: https://nation.marketo.com/t5/product-blogs/posting-code-in-discussions/ba-p/341001/highlight/true
Secondly, what do you mean by 'the if is not'? Do you mean the output being generated doesn't work? Do you mean people never get into the if side of the condition when you believe that should?
As a random suggestion, have you made sure the selfSchedulerLink field is checked in the tree on the RHS of the script editor?
Cheers
Jo
Regards
Jo
Thank you so much for that! I am very new to Marketo (used SFMC previously) so this is very much a learning process and I appreciate all of the feedback.
So, by "the if is not" I mean that every time I test this token, it returns the default link instead of the self scheduler link even when it is not empty.
I do have the Self Scheduler clicked in the right side - is this what everyone is referring to here?
Thank you again and I apologize for the lack of knowledge!
@jordannams please remember to use the Syntax Highlighter when inserting code. Although here a screenshot is also useful, it’s not possible to find code errors from a screenshot.
hi @jordannams - Seems like you haven't checked the property selfSchedulerLink is right pane of editor. Please check and confirm.
Thank you for your response - please see my update in the post above yours 🙂 Any help is greatly appreciated!
@jordannams, could you share the output you're seeing vs. the expected output using the email preview mode? Go to the Email Preview mode >> Select a test record >> Share the actual and desired outputs. Of course, as shared by users above, you'd need to check the lead field you're using in the velocity script; otherwise, the velocity can't reference its data.
I agree with the guys that inserting your code properly would have been easier, but even with the screenshot my first guess would be that you need to remove the quotation marks around the two tokens making up your "if" url. When your type actual text you need to add quotation marks, but that does not apply to tokens.
The href
attribute must be quoted. You can’t have equals signs in an unquoted HTML attribute.
(But here we are discussing something that really should be considered unreadable, and just as important unrunnable.)