How to Remove “https” From a URL and Update a New Field

0 Likes

How to Remove “https” From a URL and Update a New Field

Hi Team,

 

We have a field in Marketo that comes from our CRM ( Dynamics 365 ) , and it contains a full URL (MS Bookings link). We currently use it via the lead token in our emails, and the link works, but it doesn’t get tracked because the token URL includes “https”.

 

To address this, we're exploring the option of creating a new field and running a daily smart campaign to copy the value from the old field—but without the “https://” prefix and update it to the new one, so it can be tracked

 

Example:
Old field value: https://www.google.com
New field value: www.google.com

The idea is to update the new field using the old field’s value, removing the protocol. However, I’m unsure whether the Change Data Value flow step can handle this type of string transformation directly.

 

Could you advise on possible approaches to remove “https://” when updating the new field?

 

Any guidance on handling this scenario would be helpful.

 

Please let me know if you need anything else.

 

Regards,

Akshat

3 Comments
Jasbir_Kaur
Level 5

Hi @ashah123 - You can try the below options, if these can help -

 

Marketo's Change Data Value flow step does not support direct string manipulations, such as removing "https://" from a URL, as it only allows static values, tokens, or simple concatenations without regular expressions or substring functions.

Use a triggered Smart Campaign that fires on changes to the old field (e.g., MS Bookings URL from Dynamics 365). Integrate FlowBoost (a webhook service) to strip the protocol via JavaScript, then map the cleaned output back to the new field.

  • Set trigger: "Data Value Changes" on old field where value is known (e.g., starts with "https://").

  • Add "Call Webhook" flow step pointing to FlowBoost.

  • In webhook payload: urlWithoutProtocol = {{lead.OldField}}.replace(/^https?:\/\//,""); (handles both http/https).

  • Map response to new field (e.g., "Bookings Link Clean").

This avoids daily batch runs, processes only changes, and ensures tracking in emails by using the new token outside any protocol (e.g., https://{{lead.Bookings Link Clean}}).

2. Alternative: Velocity Script Token

For email-only use (not permanent field update), wrap the old field in a Velocity token at the program/landing page level: #set($cleanUrl = $lead.OldField.replaceFirst('^https?://', '')) $cleanUrl. Then reference {{my.CleanUrlToken}} in emails. This doesn't alter fields but enables tracking without a new field.

Test in a small batch first, as Dynamics sync might overwrite the old field—consider blocking updates on the new field if needed.

SanfordWhiteman
Level 10 - Community Moderator

☝️

ashah123
Level 3

Thanks @Jasbir_Kaur That helps alot , i did tried the option 2 which you shared and it works fine and we are planning to go ahead with that approach