Using a list in a condition

Options

Why isn't it possible to use a list in a condition with is in, for example?

Comments

  • Ray Deck
    Ray Deck Trusted Xano Expert ✭✭✭
    Options

    First, the "how" to manage this situation. You can construct that either with the "some" higher-order filter, or by structuring it in the function stack by first running "has any element" followed by testing the output of that function in your function stack.

    Stepping back, Xano's visual builders are wrappers around various subsystems. "IN" is a keyword in SQL that Xano is wrapping around in the query filtering system. The main PHP code that Xano uses for the function stack works differently, and Xano kind of matches that. That's the "why".

    And for "what's next", these kinds of subtleties come up frequently as part of our "hardest 5%" in office hours and forums on statechange.ai.

  • Pawel Magdanski
    Pawel Magdanski Member ✭✭✭
    Options

    Hi,

    I'm not 100% sure if it's available everywhere but in the case of array conditionals you can use "in" filter:

  • Michael Udinski
    Michael Udinski Administrator

    ADMIN

    Options

    @Pawel Magdanski is right, this is available as a filter. Not all the same query operators are available through the rest of the function stack but you can accomplish the same expressions with filters.