Skip to main content
New Idea

Allow for inserting Null values in case expressions

Related products:CS Other Features
matthew_lind
heather_hansen
andy_roy
gunjanm
andreammelde
+13
  • matthew_lind
    matthew_lind
  • heather_hansen
    heather_hansen
  • andy_roy
    andy_roy
  • gunjanm
    gunjanm
  • andreammelde
    andreammelde
  • tammy_c
  • Ester.Memoli
    Ester.Memoli
  • bradley
    bradley
  • benwanlessmenlo
    benwanlessmenlo
  • sarahmiracle
    sarahmiracle
  • romihache
    romihache
  • alizee
    alizee
  • jparker
    jparker
  • emilyvx ncloud
  • dayn.johnson
    dayn.johnson
  • billrlarseniii
  • alliheller
  • wscuphamabnormal

sarahmiracle

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
Forum|alt.badge.img+10
  • Author
  • VIP ⭐️⭐️⭐️⭐️⭐️
  • 354 replies
  • 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...)


jparker
Forum|alt.badge.img+4
  • Contributor ⭐️⭐️⭐️⭐️⭐️
  • 56 replies
  • 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


matthew_lind
Forum|alt.badge.img+11
  • VIP ⭐️⭐️⭐️⭐️⭐️
  • 651 replies
  • 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.


sarahmiracle
Forum|alt.badge.img+10
  • Author
  • VIP ⭐️⭐️⭐️⭐️⭐️
  • 354 replies
  • 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 😔


jparker
Forum|alt.badge.img+4
  • Contributor ⭐️⭐️⭐️⭐️⭐️
  • 56 replies
  • 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.


jparker
Forum|alt.badge.img+4
  • Contributor ⭐️⭐️⭐️⭐️⭐️
  • 56 replies
  • 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 


sarahmiracle
Forum|alt.badge.img+10
  • Author
  • VIP ⭐️⭐️⭐️⭐️⭐️
  • 354 replies
  • July 26, 2023

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


andy_roy
Forum|alt.badge.img
  • Helper ⭐️
  • 54 replies
  • 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
Forum|alt.badge.img+8
  • VIP ⭐️⭐️⭐️⭐️⭐️
  • 429 replies
  • 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)

 

 


alizee
Forum|alt.badge.img+12
  • VIP ⭐️⭐️⭐️⭐️⭐️
  • 659 replies
  • 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


benwanlessmenlo
Forum|alt.badge.img+4
  • Contributor ⭐️⭐️⭐️⭐️⭐️
  • 115 replies
  • October 10, 2024

Let’s do data right. Please allow us to work with null valued fields.


dayn.johnson
Forum|alt.badge.img+6
  • VIP ⭐️⭐️⭐️⭐️⭐️
  • 647 replies
  • October 11, 2024
benwanlessmenlo wrote:

Let’s do data right. Please allow us to work with null valued fields.

Especially when we have to build evaluate steps to check for null data (and that data is null).


alizee
Forum|alt.badge.img+12
  • VIP ⭐️⭐️⭐️⭐️⭐️
  • 659 replies
  • October 11, 2024
matthew_lind wrote:

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.

Thank you, Matthew, smart but sad :). Guess I’m going for that… MEH. MEH. MEH. MEH. MEH. 


matthew_lind
Forum|alt.badge.img+11
  • VIP ⭐️⭐️⭐️⭐️⭐️
  • 651 replies
  • October 11, 2024

 

alizee wrote:
matthew_lind wrote:

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.

Thank you, Matthew, smart but sad :). Guess I’m going for that… MEH. MEH. MEH. MEH. MEH. 

@alizee I’m remarkably talented at “Smart but Sad”, in oh-so-many ways.


alizee
Forum|alt.badge.img+12
  • VIP ⭐️⭐️⭐️⭐️⭐️
  • 659 replies
  • October 14, 2024
matthew_lind wrote:

 

alizee wrote:
matthew_lind wrote:

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.

Thank you, Matthew, smart but sad :). Guess I’m going for that… MEH. MEH. MEH. MEH. MEH. 

@alizee I’m remarkably talented at “Smart but Sad”, in oh-so-many ways.

In the land of boolean nulls, smart but sad workarounds are life saviors, and those who invent them are warriors of the light.


Reply


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