Mixpanel Community Icon

Check Event and Nested User Property Values in Kapa.ai

·
·

kapa.ai using Insights or Funnels, is there any way to check that an event property and a nested (array) user property contain the same value? The user property is a list that may or may not contain the event property.

  • Avatar of kapa.ai
    kapa.ai
    APP
    ·
    ·

    Please stand by Iva Đ. as I search the knowledge base. I normally take about 15 seconds or so. 👋

    Feel free to ask a follow-up question once I've answered by mentioning me with @kapa.ai

  • Avatar of kapa.ai
    kapa.ai
    APP
    ·
    ·

    Yes, you can check if an event property and a nested (array) user property contain the same value in Mixpanel using filters. Mixpanel supports list properties and provides specific operators for working with them.When filtering list properties, you can use the "Any" or "All" operators: - The "Any" operator filters events when the filtered value matches ANY item in the list property - The "All" operator filters events when the filtered value matches ALL items in the list propertyFor your specific use case, you would: 1. Create a filter on your event where the event property equals a specific value 2. Add another filter where the user property (list) contains that same value using the "Any" operatorFor example, if you have: - An event property called "product_id" - A user property that's an array called "favorite_products"You could create a filter in Insights or Funnels that checks: - "product_id" equals "P1" AND - "favorite_products" Any equals "P1"This would show you events where the product_id matches a value that exists in the user's favorite_products list.Mixpanel's documentation explains how list filtering works: > "The 'Any' operator filters down events when the filtered value matches ANY item in the list property. So in this example, the only event in which 'List of ProductIDs' has 'P1' present even once is Event 1, so the total event count for this filter is 1."Mixpanel List Property SupportRemember that list properties in Mixpanel have specific limits: Event Property lists are limited to 8KB, while User Profile Property lists are limited to 256KB.

    kapa.ai is still learning and improving, please let me know how I did by reacting below.

    ℹ️ Tip: Mention @kapa.ai in the thread for follow-ups or DM the app for 1-to-1 help.

  • Avatar of Iva Đ.
    Iva Đ.
    ·
    ·

    kapa.ai but can it be dynamic?

  • Avatar of kapa.ai
    kapa.ai
    APP
    ·
    ·

    Let me check the knowledge base for you again. One moment! 📚

  • Avatar of kapa.ai
    kapa.ai
    APP
    ·
    ·

    Yes, you can make this comparison dynamic using Custom Properties in Mixpanel. Custom Properties allow you to create new properties on the fly using formulas, which can help you dynamically check if an event property value exists in a user property array.For Growth and Enterprise plan users, you can create and save custom properties that can be reused across reports. Free plan users can still create custom properties, but only locally within a report.You could create a custom property that checks if the event property value exists in the user property array. While the documentation doesn't provide a specific formula example for this exact use case, you could use functions like: LBKSIN([event_property], [user_property_array])LBKSOr potentially use comparison operators to create a boolean property that indicates whether the match exists.Custom Properties: Calculate new properties on the fly explains that you can "compare different properties" and "query a list with an index," which would be relevant for your use case.Another option for Growth and Enterprise users is to use Borrowed Properties, which allows you to "borrow" a property from one event to another on the fly: Introducing Borrowed Properties: Combine data between events on the flyThis feature might help you create more dynamic comparisons between your event property and user property array.Would you like more specific guidance on implementing either of these approaches for your particular use case?

    kapa.ai is still learning and improving, please let me know how I did by reacting below.

    ℹ️ Tip: Mention @kapa.ai in the thread for follow-ups or DM the app for 1-to-1 help.