PricingBlog

Displaying nested json data from api in a list

  • .crypto618-1201441923240570960

    Crypto 618

    2 years ago

    Hopefully someone can point me in the right direction.
    I am trying to display json data from api into a list.
    the json data is attached.
    I setup the api and retrieve the response.
    I add a list.
    ul
    li
    Then add a repeat on the li.
    The objects appear, depending on how many i retrieve in the query.
    Then I create a text inside the li and try to add dynamic value from the item/index however it does not show.
    It does not recognise that I am inside the repeated element.
    Any suggestions?
    Thanks.
    1201441923806793808-Screenshot_2024-01-29_at_6.14.41_pm.png
  • .crypto618-1201442454054907956

    Crypto 618

    2 years ago

    This is my repeat
    1201442453857771582-Screenshot_2024-01-29_at_6.22.52_pm.png
  • Tod-1201442456974143538

    Tod

    2 years ago

    Great energy @Crypto 618! Your continuous contribution to the toddle Community just made you advance to Community Level 1!
    👍1
  • .crypto618-1201442726261035008

    Crypto 618

    2 years ago

    This is where I don't get access to item option
    1201442726009372752-Screenshot_2024-01-29_at_6.23.39_pm.png
  • erikbeus-1201442988707024957

    Erik Beuschau

    2 years ago

    Your repeat formula looks correct considering your json response 🤔 Could you invite me to your project? I'm happy to have a look 👍
    erik@toddle.dev
  • .crypto618-1201443030012530739

    Crypto 618

    2 years ago

    sure can
  • .crypto618-1201443335731155035

    Crypto 618

    2 years ago

    I did the invite but didn't see confirmation msg. hopefullly it worked
  • erikbeus-1201443747410481202

    Erik Beuschau

    2 years ago

    I got it
  • The missing invite confirmation is something I'll look at next https://discord.com/channels/972416966683926538/1200826273782562896/1201439970397786223 😉
    👍1
  • erikbeus-1201445343850668082

    Erik Beuschau

    2 years ago

    I found the issue. In your json response, the data was not actually an array but an object. I changed your repeat formula to the one in the attached image and now it's an array which the editor knows how to repeat over 🙂
    We could definitely do a better job at highlighting this in the API dialog and when working with formulas in general.
    1201445343628378152-Screenshot_2024-01-29_at_09.33.34.png
    🔥1
  • .crypto618-1201445832315121755

    Crypto 618

    2 years ago

    OMG lol. I have spent hours on this, lol, I should have asked sooner .lol. Thankyou so much. I will look at how you did it and try to understand. Thanks. 🙂
  • erikbeus-1201448823894048849

    Erik Beuschau

    2 years ago

    🙂 when working with objects/arrays, the formulas Entries and From entries are really useful 👍
    👍1