How to Make a Simple Formula Complicated ??

How to Make a Simple Formula Complicated ??

In my org, users sometimes like to send out birthday emails ??. That seems simple enough. We can set up some templates and a flow to send them out automatically. But the users tell me they don’t want them sent out automatically. They know their clients very well and they know that some of them just wouldn’t like it. What they want is to just be reminded that there is a Birthday coming up and then they’ll decide to send an email or not. ??

Uhhhh. Ok. How about a flow to set a task? I’ll make the task show up as completed so it really just works as a reminder. Make it a scheduled flow. Run it in the wee hours of the morning and no problem. We just need a field for it to get triggered off. I don’t want to just trigger it off the birthday date. I don’t want everyone to just get a million tasks all of a sudden that aren’t due yet. We need a way to trigger it just a few days before the birthday. ??

Our old buddy, the formula field, to the rescue. Easy: make a formula field, hide it from everyone but the Admins, and have it count the number of days until the birthday, and then have the flow trigger whenever the field is a certain number. Let’s say 2.

TODAY() - Birthday.

Boom. Easy. On with my...day...huh. ??♂?

It works but...uh. Whenever the birthday has already passed it returns a negative number. I mean, that’s fine. The flow still works and nobody’s gonna see it. Except me.......yeah....except me.

Ok. Maybe I can have it check to make sure the date isn’t in the past and if it is, it just calculates until the next birthday. A little bit of Googling and boom. ??

Oh man. That’s cool. How about that? So proud of myself. I even show my wife. She looks at it for one second and says, “What if it’s a leap year?” ??

What? Huh? How often does that even...I mean... Who cares if...Damnit.

How do you even know if it’s a leap year? I thought that was some sort of ancient wizardry that worked that out. Is Punxsutawney Phil involved somehow? ??♂?

Google, Google, Google... So apparently, it’s a leap year if the year number is divisible by four – except for end-of-century years, which must be divisible by 400. This means that the year 2000 was a leap year, although 1900 was not. ??

Blink...Blink....Riiiiight. I'ma need some help on this one.

An hour later, lots of googling, lots of ChatGPTin’ (is that a verb?) and? we have an overly complicated formula to make an output look ‘correct’ on a field I’ll probably hardly ever look at. ??♂?

It can be a tough balance sometimes to make you're users happy and make yourself happy (Or in my case just less insane. ) and if you're not careful you can end up making a lot more work for yourself that doesn't add value to your users. And that is really the end goal.

Steven Trumble

12x Salesforce Certified Consultant/Developer | I help explain Salesforce

1 年

Does this appropriately handle if someone is born 01Jan or 02Jan?

要查看或添加评论,请登录

社区洞察

其他会员也浏览了