Skip to main content
sarahmiracle
VIP ⭐️⭐️⭐️⭐️⭐️
July 21, 2023
New Idea

Allow for inserting Null values in case expressions

Related products:CS Other Features
  • July 21, 2023
  • 15 replies
  • 216 views

It would be great if we could insert Null values for Case Expressions. The current configuration requires us to provide a value, even if that value is a Custom value.

Use Case:

  • I’m calculating an “Age” field for a professional services project. If the project is still Active, I want to insert my calculated Project Age field. If the project is not still Active, then I want a Null value. 

I can’t accomplish this use case as Case Expressions require a value.

15 replies

sarahmiracle
VIP ⭐️⭐️⭐️⭐️⭐️
July 21, 2023

This was in Data Designer -- I haven’t tested if I can insert a Null value in Case Expressions in Horizon Rules, but I will assume I cannot given the UIs are very similar. I’m not sure if I could have done this in Bionic (can’t remember...)

Customer Success Systems Admin @ Amplitude, 3x Gainsight CS Ops Product Council Member
jparker
Contributor ⭐️⭐️⭐️⭐️⭐️
July 21, 2023

I’d definitely like to have an explicit NULL value too, but I think the workaround to this is putting a space as the custom value and it acts like NULL

Looking for my next role: Gainsight Lead / CS Ops Product Council Member. Let's connect: https://www.linkedin.com/in/jon-parker/
matthew_lind
VIP ⭐️⭐️⭐️⭐️⭐️
July 21, 2023

I’m upvoting….and in the meantime I’ve previous tackled this with a very poor work-around.

  1. Create a custom field in an object. The sole purpose of this custom field is to be a Null. No default values, no rules to populate. It literally just sits there.
  2. Pull that custom field into your fetch. Then in your CASE statement, when you need the Null, you “populate” your CASE statement by pointing at that custom field.

I agree that the product could ideally do this as Sarah proposes, but if you really need it now, you’ve got a work-around.

Making people their best....currently disguised as a CS Ops Architect. How can I contribute to your success?
sarahmiracle
VIP ⭐️⭐️⭐️⭐️⭐️
July 24, 2023

I think the workaround to this is putting a space as the custom value and it acts like NULL

 

@jparker actually, in DD and Horizon Rules, it won’t accept a space as a custom value! I believe old Bionic Rules case statements might have allowed this, but it isn’t allowed in DD or HRE 😔

Customer Success Systems Admin @ Amplitude, 3x Gainsight CS Ops Product Council Member
jparker
Contributor ⭐️⭐️⭐️⭐️⭐️
July 25, 2023

That’s strange. I just double-checked and I can create a new HR and use a space as the custom value for the case expression output. Leaving it blank throws an error when I first save but having a space allows it to be saved.

Looking for my next role: Gainsight Lead / CS Ops Product Council Member. Let's connect: https://www.linkedin.com/in/jon-parker/
jparker
Contributor ⭐️⭐️⭐️⭐️⭐️
July 25, 2023

Actually, I think the difference between mine working and yours not working is that I’m using a string field and you’re using a number 

Looking for my next role: Gainsight Lead / CS Ops Product Council Member. Let's connect: https://www.linkedin.com/in/jon-parker/
sarahmiracle
VIP ⭐️⭐️⭐️⭐️⭐️
July 26, 2023

@jparker ah!! Yes, you are onto something!!

Customer Success Systems Admin @ Amplitude, 3x Gainsight CS Ops Product Council Member
andy_roy
Helper ⭐️
August 24, 2023

Upvoted.  I was going to concat a list of Case fields.  Even if I can use a space, that will probably generate some clunky results.  Back to the (very messy) drawing board...

romihache
VIP ⭐️⭐️⭐️⭐️⭐️
February 14, 2024

Absolutely agree! 
So many extra transforms could be avoided! If the output is a string, I do the case with a space as output in lieu of null,  and then a full trim to have an actual null, but this workaround only works for a string output as noted above. 
Matthew’s workaround is the way I do this if is a numeric field (btw, thank you @sarahmiracle and @matthew_lind for your help -many moons ago- via Slack about this!)
 

There are two other ideas asking for the same, can they be merged @anirbandutta ? As rules engine and DD have now the same interface, they are all asking for the same 😁 (Bradley also noted that in the second idea)

 

 

Continuous improvement is better than delayed perfection
alizee
VIP ⭐️⭐️⭐️⭐️⭐️
October 8, 2024

Hello!

In the old rules and query builder, we could set string default values to null.

 

In Horizon Rules / Dynamic JO, we can’t: 

Meanwhile, a boolean can be null. 

If every field can be null including booleans (excluding GSIDs), then surely the default value for a string should be able to be null. 

This is inconsistent and somewhat illogical on top of being annoying for concat formulas. 

Please fix this!

A

The most expensive part of building is the mistakes. That's true in construction. Not so much in CSOps. So ask questions, make mistakes and learn. All views expressed here are my own.