Filter an array when a field CONTAINS a value

  • benjabievres-1305156483456962651

    benjabievres

    4 months ago

    Hey!
    I've been testing a filter on the name of items in an array, but I didn't find any "contains" formula.
    So I ended up using Match and checking if the lenght of the resulting string is not 0, but it's complex πŸ˜…

    Is there any simpler way to do it?
    Thanks!!
    1305156485382275144-image.png
  • olumise-1305161068787794034

    Olumise

    4 months ago

    What is your use case here, are you trying to fuzzy search through an array when a user start typing?
  • benjabievres-1305161960123404328

    benjabievres

    4 months ago

    Yes, I get a list of objects (Make scenarios) from an API call, and I want the user to type text in an input so that it filters by the name of the scenarios.
    It works fine, but I’m sure there is a simpler way to build the filter.
  • Tod-1305161961620766720

    Tod

    4 months ago

    Great energy @! Your continuous contribution to the toddle Community just made you advance to Community Level 1!
  • olumise-1305162274046214285

    Olumise

    4 months ago

    The best and fastest way is using the formula in @NoCode ProCode video:

    https://youtu.be/gz0nqa1RibM?si=Xe638CsPH7Ig_gfg
  • Just copy the code in your page and you will see the option in the formula editor
  • tomthebigtree-1305162524244705332

    Tom Ireland

    4 months ago

    @ What about Includes?
  • benjabievres-1305169542145900554

    benjabievres

    4 months ago

    Nice one @Tom Ireland ! Exactly what I needed! It works perfectly after setting everything to lowercase. @Olumise Fuzzy Search is just insane!! So far I didn't manage to make it work (it doesn't return true/false), but maybe I did something wrong in my configuration. Anyway thank you both!
    πŸ™Œ2
  • nocodeprocode-1305213333737308270

    NoCode ProCode

    4 months ago

    πŸ™πŸ’›

Stop scrolling. Start building.

toddle is a visual web app builder that rivals custom code β€” but accessible to your entire team!

Try toddle β€” it's free!

Β© Copyright 2024 toddle. All rights reserved.