Mixpanel Community Icon

Resolving Event Property Type Issues: Converting Object to String

·
·

I have an event property that, for some reason or another, is set to "object"; this is a problem, because now my devs are sending it as a string, and I have no (easy) way of accessing it in reports... is there any way to force cast it into a string without using custom properties?

  • Avatar of Andrew S.
    Andrew S.
    ·
    ·

    You are right. A custom property would allow recast as a string. Otherwise you can just recast it each time in an insight in the breakdown with the submenu. But if you want always the custom property is your best option

  • Avatar of Vlad S.
    Vlad S.
    ·
    ·

    oh you can't recast it in the breakdown, actually, you have to make a custom property

  • Avatar of Andrew S.
    Andrew S.
    ·
    ·
  • Avatar of Andrew S.
    Andrew S.
    ·
    ·

    Same with an object list

  • Avatar of Vlad S.
    Vlad S.
    ·
    ·

    this is what i get when I hover on an object property, there's no kebab menu

  • Avatar of Vlad S.
    Vlad S.
    ·
    ·

    I can click into it to see the children, and I can change the children's data types, but it's no use if the children are not set

  • Avatar of Andrew S.
    Andrew S.
    ·
    ·

    You say it’s an issue for you if the children are not set. Can you use the “is set” operator to ignore those?

  • Avatar of Vlad S.
    Vlad S.
    ·
    ·

    oh, I mean the property value is not parseable as an object, but the interface doesn't let me select it, it forces me to select one of the children, so it really doesn't matter that I can change operators or types on the children, since they don't exist (and I don't expect them to)

  • Avatar of Vlad S.
    Vlad S.
    ·
    ·

    so in the example above, I can't just select "error" in the breakdown, if I click it it takes me to the second menu I posted and my options are to either select a child or cancel the selection altogether

  • Avatar of Vlad S.
    Vlad S.
    ·
    ·

    unless I'm missing something, which is entirely possible

  • Avatar of Andrew S.
    Andrew S.
    ·
    ·

    Yeah sounds like you have to do that as a custom property with the string() function.

  • Avatar of Vlad S.
    Vlad S.
    ·
    ·

    funny thing about that, the UI in the custom property creator does, in fact, allow me to typecast the object, so I don't even have to use string()

  • Avatar of Andrew S.
    Andrew S.
    ·
    ·

    What I tend to do is make the property as the original name with _recast at the end so I can remember which is which.