Skip to main content
Solved

Conditional formula url

  • May 7, 2024
  • 0 replies
  • 287 views

Forum|alt.badge.img+5

I'm trying to build a conditional url formula where if a multiple choice field equals a certain person, display this url. Unfortunately, it's not pulling in anything. Here is my current syntax in the formula URL field:

If(ToText([Contractor Operations Manager])="Sally Struthers","https://calendly.com/sally.struthers") &
If(ToText([Contractor Operations Manager])="Fred Flinstone","https://calendly.com/fred-flinstone")

Any thoughts?

Best answer by MarkShnierYou

You need to see what the result is of 

ToText([Contractor Operations Manager])

I suspect that the field is a user type field so the totext result of that will be either their email address or the or their username if they have one.

If indeed its a userid field, then you should chjnage it to this

Case(UserToEmail([Contractor Operations Manager]),

"struthers@mycompany.com","https://calendly.com/sally.struthers",

"fflintstone@ompany.com","https://calendly.com/fred.flintstone")

 

Having said that, it's not good practice to hard code this into a formula field as these people will change over time. It would be a lot better if you could have a table of operations managers and pull in a lookup of the calendy URL 

 

 

This topic has been closed for replies.

Forum|alt.badge.img+20
  • Registered
  • May 7, 2024

Try this. I also like to put the if statements on separate lines for cleanliness.

If(

ToText([Contractor Operations Manager])="Sally Struthers", "https://calendly.com/sally.struthers",

ToText([Contractor Operations Manager])="Fred Flinstone", "https://calendly.com/fred-flinstone"

)


MarkShnierYou
Forum|alt.badge.img+24

You need to see what the result is of 

ToText([Contractor Operations Manager])

I suspect that the field is a user type field so the totext result of that will be either their email address or the or their username if they have one.

If indeed its a userid field, then you should chjnage it to this

Case(UserToEmail([Contractor Operations Manager]),

"struthers@mycompany.com","https://calendly.com/sally.struthers",

"fflintstone@ompany.com","https://calendly.com/fred.flintstone")

 

Having said that, it's not good practice to hard code this into a formula field as these people will change over time. It would be a lot better if you could have a table of operations managers and pull in a lookup of the calendy URL