Pricing Blog

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

  • alice_alexandra-1355082798314029156

    alice_alexandra

    4 months 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?
  • alice_alexandra-1355084624136638554

    alice_alexandra

    4 months ago

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

    Tod

    4 months 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

    4 months ago

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

    alice_alexandra

    4 months 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

    4 months 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

    4 months ago

    Okay, thanks. Appreciate it!
  • andyputilin-1365361137025286226

    Andy Putilin

    3 months ago

    did we ever find a solution for this?
  • Tod-1365361138740756551

    Tod

    3 months ago

    Great job @Andy Putilin! Your contribution to the Nordcraft Community just made you advance to Community Level 2! 🌲