Using IF and Contains in a calculated fields | Community
Skip to main content
Level 4
May 30, 2025
Solved

Using IF and Contains in a calculated fields

  • May 30, 2025
  • 1 reply
  • 957 views
I am trying to create a calculated field for a series of Tasks.
If the Task name Contains the number "1" I need it to display a date from the Project custom form.
I was able to return a True/False result using CONTAINS and I have been able to display the date without a condition but when combining the IF and CONTAINS functions I am getting no result.
Here is my expression - can anyone help?
IF(CONTAINS({name},"1"),{DE:UKI - Bet Offer 1 Banner Live Start Date & Time},"")
Best answer by _Manish_Singh

Hmm.. It would be..

IF(CONTAINS("1",{name}),{project}.{DE:UKI - Bet Offer 1 Banner Live Start Date & Time},"")

1 reply

_Manish_Singh
Level 9
May 30, 2025

Hello @thomasne2, Please try this..

IF(CONTAINS("1",{name}),{DE:UKI - Bet Offer 1 Banner Live Start Date & Time},"")
ThomasNe2Author
Level 4
May 30, 2025

Hi Manish - that's giving me N/A unfortunately. I have checked that the {name} is pulling from Task and the Custom Field is pulling on Project. 

ThomasNe2Author
Level 4
May 30, 2025

Hmm.. It would be..

IF(CONTAINS("1",{name}),{project}.{DE:UKI - Bet Offer 1 Banner Live Start Date & Time},"")

That is working a charm! Thank you! How can I stack this up with more conditions? For example now if the Task name contains a 2 I would now like another field to be pulled in? I have copied the expression and added it after separate with a comma how I would anticipate but I am getting an error!

Thanks so much for the help!