PricingDocsAcademy
Bluesky ...
Fri, Dec 13, 8:04 AM

Filter an array when a field CONTAINS a value

  • /attachments/1305156483456962651/1305156485382275144/image.png

    benjabievres

    1 month 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!!
    image.png
  • Olumise

    1 month ago

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

    1 month 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

    1 month ago

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

    1 month 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
  • Tom Ireland

    1 month ago

    @ What about Includes?
  • benjabievres

    1 month 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
  • πŸ‘1
  • NoCode ProCode

    1 month 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.