Skip to main content
New Idea

Case expression/date option

Related products:None
irit_eizips
kristin_f3c469
kate_popp
sidhu
  • irit_eizips
    irit_eizips
  • kristin_f3c469
    kristin_f3c469
  • kate_popp
    kate_popp
  • sidhu
    sidhu

manda.edmonds

It would be fantastic if we had the option to use dates (and dates from fields) in the case expressions of the Rules Engine.

 

The use case for this would be analysis on data requiring a date to ultimately be the item produced (i.e., opportunity analysis, determine specific date, load to company).

12 replies

alexander.mahan
Forum|alt.badge.img+1

I also ran into a need for date values as a result of a case expression when trying to define a ‘last activity date’ on Goals or Success Plans. Since the modified date on the Goal/SP does not update when an associated CTA/Objective is updated, and the CTA’s modified date isn’t updated when a timeline entry is logged against it, I needed to build a rule to pull the max modified date at each level and merge it all back to the Goal/SP in order to get a count of records with interactions against it in the last 90 days. I ended up using a transform task to filter the records included where none of the associated dates were within 90 days, but a case expression would have allowed me to condense all the date fields into a single ‘last activity date’ value and filter on that.


Forum|alt.badge.img+2
  • Expert ⭐️
  • 227 replies
  • August 28, 2023

You can achieve this a few different ways today as a workaround.

 

A)

-Add a transformation task where you subtract your date fields from today. giving you numbers. I.E. 8/29/23 and 8/30/23 ( 1 and 2)

-second transformation filter your date filters. If 8/30/23 >= to 8/29/23 then output your 2 else output your 1

-third transformation, take your case date field and add date function to today. So if two was from previous task then 2 plus 8/28/23 is outputting 8/30/23.

 

B)

-Take your date fields in a transformation task and To String, a function in HRE or DD not sur ein bionic, them.

-In a second transformation filter on your date fields and output your string date fields, much like option A.

-Third transformation you To Date, function in HRE and DD not sure in bionic, your date string fields.


alexander.mahan
Forum|alt.badge.img+1

@Wayne For the third transformation in option A, should there be an option to pass the CaseDate value into the add date function? It seems to only accept a typed value rather than a field value.

In this example I’m trying to define the MaxDate value to show the most recently active date per record (completion occurs after enrollment, so if completion is not null, MaxDate should be the completion date, else enrollment date). With the option A workaround I get as far as set 3 before I run into this issue. Here’s the data I’m working with for context;

 


manda.edmonds
Forum|alt.badge.img+2
  • Author
  • Contributor ⭐️⭐️⭐️
  • 12 replies
  • October 6, 2023

My biggest issue with additional steps is they take longer to run and produce tech debt!


alexander.mahan
Forum|alt.badge.img+1

Option B works perfectly, for anyone else that stumbles across this post. Thanks again @Wayne for the workarounds!


Forum|alt.badge.img+2
  • Expert ⭐️
  • 227 replies
  • October 9, 2023
manda.edmonds wrote:

My biggest issue with additional steps is they take longer to run and produce tech debt!

 

Agreed, but you will always have tech debt. You have to find the happy medium you and your company is willing to accept. Also, some things the business side does not want to hear “no”, so you have to do it.

 

alexander.mahan wrote:

@Wayne For the third transformation in option A, should there be an option to pass the CaseDate value into the add date function? It seems to only accept a typed value rather than a field value.

 

 

You are correct sorry about that. Option A you have to do with Bionic rule, seems like you can only add via a field not value with it. I’m going to go post in Horizon Rules Engine that this si a parity issue.

 

alexander.mahan wrote:

Option B works perfectly, for anyone else that stumbles across this post. Thanks again @Wayne for the workarounds!

 

Happy it worked out!


Stuart
Forum|alt.badge.img+3
  • Helper ⭐️⭐️
  • 144 replies
  • March 22, 2024

Appreciate there is a workaround for this, having date as a datatype in this feature would be a huge win for date evaluation/comparison, making the output the date you’re looking for.


Stuart
Forum|alt.badge.img+3
  • Helper ⭐️⭐️
  • 144 replies
  • April 26, 2024

Resurfacing this again as I continue to run into this.. The workaround for not being able to evaluate dates in a case expression is painful to build. This is probably one of the times I’d take the feature being added (even with limitations) rather than not have it!


Forum|alt.badge.img
  • Contributor ⭐️⭐️
  • 7 replies
  • June 4, 2024

Agree 100% with all of the above. 

It’s great to have a workaround for this common requirement but that should not diminish the fact that this is a common requirement and the user base needs a Date/DateTime data type to be added to the field type options in the Case functionality.

I see no technical reason that Date fields could not be included in Case field buildouts.


Forum|alt.badge.img+2
  • Contributor ⭐️⭐️⭐️⭐️⭐️
  • 88 replies
  • October 17, 2024

Hi, 

I have an example in this vein. We have agreements and subscriptions and I need to identify the “true renewal date”. So I’d like to say, “If X date field is not null, use X date. Otherwise, Default Y Date.” With a support date type option the date fields cannot be set as “then” or “default”. We are doing this in a data design, so we are further limited by not being able to use things like rules actions to supplement achieving this.


sarahmiracle
Forum|alt.badge.img+10
  • VIP ⭐️⭐️⭐️⭐️⭐️
  • 354 replies
  • October 30, 2024

Related idea:

Still think this would be a nice admin quality-of-life enhancement.

When you’re trying to achieve a simple “if // then” logic, the first thought is always a case expression. When you’re not able to do that for certain data types, you immediately get stumped.


angela_domenichelli
Forum|alt.badge.img+12
  • Contributor ⭐️⭐️⭐️⭐️⭐️
  • 245 replies
  • November 19, 2024

I would love this!  This is a current pain point for a date to trigger a workflow in data designer.


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings