What's the best "Toddle" way to deal with heterogenous arrays returned from a data source?

  • alice_alexandra-1355082798314029156

    alice_alexandra

    6 days ago

    I am working with the Notion API, which returns each "block" as an individual item in an array. Each block has a "type" (e.g., heading_1, paragraph, bulleted_list_item) that defines parts of its inner structure.

    So, when working in Toddle, I can very easily work with the first item in the array, but I don't know how to easily access the second item of the array to build a formula around it uniquely.

    Obviously, I can just move my data around on the backend, so that the first item keeps becoming the one I need to work with, but this feels more painful than the usual Toddle experience.

    Any advice?
    1
  • alice_alexandra-1355084624136638554

    alice_alexandra

    6 days ago

    I think I answered my own question, using "Filter"—but let me know if there's a better way!
  • Tod-1355084625915154563

    Tod

    6 days ago

    Great energy @alice_alexandra! Your continuous contribution to the toddle Community just made you advance to Community Level 2!
  • andreasmoller-1355150601914417152

    Andreas Møller

    6 days ago

    You can use get to extract any item by index
  • alice_alexandra-1355152972950012126

    alice_alexandra

    6 days ago

    Thanks, @Andreas Møller but I more mean inside of an already repeating item. It's as if I need to temporarily access a different "parent" item in the leftmost block, just to see some properties that don't exist on the current array item.
    1355152972623122593-CleanShot_2025-03-28_at_14.11.40.png
  • andreasmoller-1355153275552399533

    Andreas Møller

    6 days ago

    No we don’t have a mechanism for that at the moment but it’s something we have been discussing how to solve 🙂
  • alice_alexandra-1355157747548684500

    alice_alexandra

    6 days ago

    Okay, thanks. Appreciate it!

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.