Skip to main content
Solved

Creating Groups from a Segment of Text in Text Field

  • October 13, 2022
  • 4 replies
  • 46 views

Forum|alt.badge.img+3

Hello!

I would like to create groups based on a “contains” value in a text field. Since this is not an available option, I think I am going to need to use a formula to create a field that I can group by.

Objective: Create a conditional formula that will select a drop-down based on conditions.

Sample Data:

What I would like to happen:
If Campaign Name contains “PF_MU30_Weekly” Change Email Type to “Weekly”
If Campaign Name contains “PF_MU30_ReEngagement” change Email Type to “ReEngagement”
If Campaign Name contains “PF_MU30_Engagement” change Email Type to “Engagement”

From here then I can group by the Email Type field.

Thank you for your help!

Best answer by Nathaniel_Grano

Hi @Lindsay_Kirsch !

A Single-Select field (i.e. “dropdown”) cannot contain a formula. Only a formula-type field can contain a formula. If you don’t care about the “Email Type” field being a dropdown menu, then you can make it a Formula type field and use this formula:

IF(SEARCH("PF_MU30_Weekly",Name),
  "Weekly",
  IF(SEARCH("PF_MU30_ReEngagement",Name),
    "ReEngagement",
    IF(SEARCH("PF_MU30_Engagement",Name),
      "Engagement"
    )
  )
)

If you need that to be a dropdown column, then there are some other possibilities, but it will be more complex and possibly involve an automation.

4 replies

Forum|alt.badge.img+13

Hi @Lindsay_Kirsch !

A Single-Select field (i.e. “dropdown”) cannot contain a formula. Only a formula-type field can contain a formula. If you don’t care about the “Email Type” field being a dropdown menu, then you can make it a Formula type field and use this formula:

IF(SEARCH("PF_MU30_Weekly",Name),
  "Weekly",
  IF(SEARCH("PF_MU30_ReEngagement",Name),
    "ReEngagement",
    IF(SEARCH("PF_MU30_Engagement",Name),
      "Engagement"
    )
  )
)

If you need that to be a dropdown column, then there are some other possibilities, but it will be more complex and possibly involve an automation.


Forum|alt.badge.img+3
  • Author
  • Participating Frequently
  • October 13, 2022

Hi @Lindsay_Kirsch !

A Single-Select field (i.e. “dropdown”) cannot contain a formula. Only a formula-type field can contain a formula. If you don’t care about the “Email Type” field being a dropdown menu, then you can make it a Formula type field and use this formula:

IF(SEARCH("PF_MU30_Weekly",Name),
  "Weekly",
  IF(SEARCH("PF_MU30_ReEngagement",Name),
    "ReEngagement",
    IF(SEARCH("PF_MU30_Engagement",Name),
      "Engagement"
    )
  )
)

If you need that to be a dropdown column, then there are some other possibilities, but it will be more complex and possibly involve an automation.


Hello Nathaniel! Thank you for the quick response!

I am getting this error when I paste your recommendation:


Forum|alt.badge.img+13

Hello Nathaniel! Thank you for the quick response!

I am getting this error when I paste your recommendation:


Hi again,
yes, you’ll need to change the word “Name” in the formula to be your column’s name, which I believe is “Campaign Name” from your photo. Since that has a space in it, it needs to be wrapped in curly braces:

IF(SEARCH("PF_MU30_Weekly",{Campaign Name}),
  "Weekly",
  IF(SEARCH("PF_MU30_ReEngagement",{Campaign Name}),
    "ReEngagement",
    IF(SEARCH("PF_MU30_Engagement",{Campaign Name}),
      "Engagement"
    )
  )
)

Forum|alt.badge.img+3
  • Author
  • Participating Frequently
  • October 14, 2022

This worked! Thank you so much!