We have an intake form to generate URLs with UTMs parameters. I have created a new form with additional functionality. During testing, I need both the old and new forms to work.
My current Formula field concatenates the URL (Root Link) with the UTM parameters and values. There is also a check to determine if the URL provided in the Root Link field contains a "?". If it does, then the concatenation output is handled differently:
IF(FIND("?", {Root Link})=0,
{Root Link}&{Source Parameter}&{Source Input}&{Medium Parameter}&{Medium Input}&{Campaign Parameter}&{Campaign Input (Child Campaign Name_Linked)}&{Content Parameter}&{Content Input},
{Root Link}&"&utm_source="&{Source Input}&{Medium Parameter}&{Medium Input}&{Campaign Parameter}&{Campaign Input (Child Campaign Name_Linked)}&{Content Parameter}&{Content Input})
My new form has the option to create some additional link types based on content. If you choose that option, the Root Link field is ignored, and the Media Viewer Type is considered instead.
I have a working formula for the new form which does not consider whether there is a "?" in the Root Link since it will not show that field if a "Media Viewer" type is picked on the form.
IF(
{Root Link},
{Root Link}&"?utm_source="&{Source Input}&"&utm_medium="&{Medium Input}&"&utm_campaign="&{Campaign Input (Child Campaign Name_Linked)}&"&utm_content="&{Content Input},
IF({Media Viewer Type}="Landing Page",
"https://www.company.com/"&{Locale}&"/media-viewer?type=m&d="&{LP Name}&"&utm_source="&{Source Input}&"&utm_medium="&{Medium Input}&"&utm_campaign="&{Campaign Input (Child Campaign Name_Linked)}&"&utm_content="&{Content Input},
IF({Media Viewer Type}="PDF",
"https://www.company.com/"&{Locale}&"/media-viewer?type=mp&d="&{PDF Name}&"&utm_source="&{Source Input}&"&utm_medium="&{Medium Input}&"&utm_campaign="&{Campaign Input (Child Campaign Name_Linked)}&"&utm_content="&{Content Input},
IF({Media Viewer Type}="Video",
"https://www.company.com/"&{Locale}&"/media-viewer?type=v&d="&{Video ID}&"&utm_source="&{Source Input}&"&utm_medium="&{Medium Input}&"&utm_campaign="&{Campaign Input (Child Campaign Name_Linked)}&"&utm_content="&{Content Input},
IF({Media Viewer Type}="Flipbook",
"https://www.company.com/"&{Locale}&"/media-viewer?type=i&d="&{Flipbook Name}&"&utm_source="&{Source Input}&"&utm_medium="&{Medium Input}&"&utm_campaign="&{Campaign Input (Child Campaign Name_Linked)}&"&utm_content="&{Content Input},
"error")
)
)
)
)
If I use that new formula while the old form is still in use and someone provides a URL with a "?" it will output a URL with two questions marks in it, which won't work.
My efforts to combine those two formulas results in the Formula field showing only the UTM parameters portion of the URL, and not the whole URL when a Media Viewer type is chosen.
How can I combine the old and new formulas so that:
- If the old form is used, it is still checking the Root Link for a "?" and the Formula field is populating with the full URL with UTM parameters and values.
- If the new form is used, regardless of whether a Root Link or a Media Viewer Link is being used, the Formula field is populating with the full URL with UTM parameters and values.
Thank you.