Forum Discussion

RenzoM's avatar
RenzoM
Practitioner
10 months ago

Custom Attribute with Date not filtering

Hi everyone!

We're having issues to use the filters for dates on a Custom Attribute field. We tested this on segments to get the exact calculation, and we get 0 users. We tried with 'more than', 'less than', and all other options. The only option that works is when using 'is not blank'. 

The format used to upload this by our Data Team was 'yyyy-mm-dd' as '2024-02-08'.

Also, from the Dashboard Menu, going through Data Setting / Custom Attributes we saw that the objects are being automatically detected as Time.

Does any else had this issue? How are you uploading date custom attributes?

Thanks!

  • Hi DavidO!

    Thanks for your reply! 

    After talking with Braze Technical Support, they found the problem. Looks like the API config wasn't set up correctly. 

    This is the proper code:

    "custom_attribute_with_date": {"$time" : "2024-03-10"}
    After the ' "$time": ' tag, everything goes with the ISO 8601 format, as we said on previous messages.
     
    I hope that this helps anyone else with this issue ðŸ˜Š
  • Hi RenzoM! 

    We use several Custom Attribute fields for date/timestamps and populate the full timestamp: 

    Ex: Apr 07 2022 10:48 am -04:00

    Have you tried testing when using both the date and time in this field? Also noting that our date format is different from yours (but am not sure if this is indeed correct!).

    • RenzoM's avatar
      RenzoM
      Practitioner

      Hi LizBordonaro!

      Thanks for your reply. I tried populating the field with the format you provided and still doesn't work. With date and time too.

      By any chance do you info on how your custom attribute field was configured? Do you use ISO 8601 format?
      Thanks!

      • LizBordonaro's avatar
        LizBordonaro
        Active Member II

        You're most welcome!

        I can see we're bringing the attribute in as the data type time,  but the format isn't specified in our internal data model.  It does not appear to be in ISO 8601 format.

  • DavidO's avatar
    DavidO
    Strategist II

    Hi RenzoM 

    It appears 'yyyy-mm-dd' is an acceptable format according to the docs.

    API User Attributes Object (braze.com)

    Without seeing the field even though it is being detected as time, is it possible it's being stored as a string and not a date/time object? This might explain why it can only be filtered as null or not null but not be filtered by date/time?

    😊


    • RenzoM's avatar
      RenzoM
      Practitioner

      Hi DavidO!

      Thanks for your reply! 

      After talking with Braze Technical Support, they found the problem. Looks like the API config wasn't set up correctly. 

      This is the proper code:

      "custom_attribute_with_date": {"$time" : "2024-03-10"}
      After the ' "$time": ' tag, everything goes with the ISO 8601 format, as we said on previous messages.
       
      I hope that this helps anyone else with this issue ðŸ˜Š