Solved

Glob match an empty list []

  • 30 September 2021
  • 3 replies
  • 1017 views

I need a way to be able to tell the difference in Amplitude between when an event property’s value is an empty array/list “[]” vs. when the event did not receive a value for that event property at all.

 

Doing the usual = (none) or set is (none) doesn’t work at telling them apart. I think I can use the glob match function but I’m struggling to figure out what the correct syntax would be since the square brackets are used as part of the glob match language. How do I escape them and write a glob match string that resolves to []?

 

Basically, can I create a chart that can capture the difference between the events in the 2 screenshots below (specifically for the user property called “updates.EOC”)?

 

Event where the property’s value is an empty array

 

Event without the property at all

 

Thanks in advance!

icon

Best answer by tracy.guo 1 October 2021, 17:53

View original

3 replies

Userlevel 4
Badge +3

Hi @ynadeem ! Thanks for your question.

To my knowledge, empty arrays will always be treated as (none) values, so there wouldn’t be a way to filter for an empty array. Like you said, using “set is” still returns all none values. Glob match likely won’t work since the empty array doesn’t technically have any values to query on and the brackets are not stringified for querying either. 

That said, I’m curious if anyone else in the community has any ideas too!

Userlevel 7
Badge +10

Hey @ynadeem ,

Agree with Tracy here.  I tried sending some test events on my end with (none) vs [] , and both of them evaluated to none in the segmentation chart. If you really need to find the presence of [], then sending it as a string ( "updates.EOC": "[ ]" ) seems like the best option.

Userlevel 7
Badge +10
 "updates.EOC": []  vs  "updates.EOC": "[]"

 

Reply