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).
Page 1 / 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.
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.
@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;
My biggest issue with additional steps is they take longer to run and produce tech debt!
Option B works perfectly, for anyone else that stumbles across this post. Thanks again @Wayne for the workarounds!
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.
@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.
Option B works perfectly, for anyone else that stumbles across this post. Thanks again @Wayne for the workarounds!
Happy it worked out!
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.
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!
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.
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.
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.
I would love this! This is a current pain point for a date to trigger a workflow in data designer.
If you ever had a profile with us, there's no need to create another one. Don't worry if your email address has since changed, or you can't remember your login, just let us know at community@gainsight.com and we'll help you get started from where you left.
Else, please continue with the registration below.