Hi, Rudderstack Team! I am using Rudderstack JavaS...
# support
s
Hi, Rudderstack Team! I am using Rudderstack JavaScript SDK and have a question regarding how Rudderstack manages
null
values in the
properties
object that is passed to the
track()
function. I am trying to send
emailNotifications: null
property, and it is correctly returned to the callback function of the
track()
function still having a value of
null
, but in the actual request's payload the
emailNotifications
property is absent from the
properties
object (the same behavior if I set the value as
undefined
). So, I wonder is this intentional and the only way it works or could it be somehow configured not to filter out the empty properties?
m
Hey There! 👋 Your message has been received by the RudderStack team. We will forward this request to your Technical Account Manager, and they will get back to you shortly. Please use the thread for any additional comments.
Hi Illia, can you provide what destination you are sending the data to? So for some destination rudderStack removes null properties before sending the data to the destination.
s
Not sure I can share the full URL as it contains company subdomain, but here it is https://{company-subdomain}.rudderstack.com/v1/track
m
Sorry I misunderstood. So you are saying the SDK is removing null parameters that are added to the properties object? I understand that the 2nd image is the network call, can you explain what the first image?
s
Sorry if I misled you, the first image depicts the object which is passed to the
track()
callback function (I just logged this object to the console)
And the
properties
object inside is the object I pass to the
track()
call: e.g.
window.rudderanalytics?.track('emailNotificationsEvent', properties)
@shy-kite-21035 Hi! So, could you, please, help with the issue of properties with
null
values getting filtered out?
m
Yes, Hi so the null properties do get filtered in the JS SDK and this is by design. You can however, send the property as either Boolean (True/False) or Empty Object ({}), Empty String ("") .
gratitude thank you 1
s
Great, thank you!
m
Sorry for the delayed response
s
Don't worry, that's fine 🙂