API Data shows only in Toddle

  • /attachments/1326318360509550654/1326318360769859615/image.png

    vanishklift

    7 days ago

    Hey everyone!

    I’ve connected one API endpoint without any input, and it’s displaying correctly both in the Builder and on the branch site in Chrome. However, the API endpoint where I provide an item_id to retrieve only objects matching that item_id is behaving differently. It shows everything as expected in the Builder but doesn’t display anything on the branch site in Chrome.

    I hope this explanation makes sense! Any ideas on what might be causing this?
    image.png
    😭1
  • Max

    2 days ago

    Is there an error in your browser console?
  • vanishklift

    1 day ago

    no there isnt :/
  • /attachments/1326318360509550654/1328356147492683867/image.png

    vanishklift

    1 day ago

    In Scources there is only one API endpoint (it should be 2 I use 1 endpoint for the businesses and one for their services, I give the businessid as an input in xano)

    Also in the Network-tab no signs of the service api

    And the console is empty (also when I refresh with the Info-Window open)
    image.png
    image.png
    image.png
  • unicodes

    1 day ago

    Make sure to respect the same conditions of the Test Values. I would recommend console log all the API's inputs in order to understand if the API call is the same as in test mode.
  • unicodes

    1 day ago

    Popular services make me think that there are some conditions set in test mode (maybe dependent on a specific user ID that has certain data), and in the live environment, the user is different or the conditions are not the same as in test mode. As for the API system, everything is working fine; I do not have any issues with the API system.
  • unicodes

    1 day ago

    @vanishklift share please some API's screens for better understanding your situation.
  • vanishklift

    1 day ago

    sure thing, give me a sec
  • vanishklift

    1 day ago

    whuch screens do you need, those in toddle or xano
  • unicodes

    1 day ago

    from toddle (inputs, Parammeters, Headers)
  • /attachments/1326318360509550654/1328366722201161828/image.png

    vanishklift

    1 day ago

    On the feed page, I list businesses using the Businesses API endpoint. Each business is displayed on a card, and the card has a link. That link includes the current business index (from the API) in the URL.

    When you click the link, it opens the business page. On that page, I use the Services API to fetch the services for the business. Here's the tricky part: since my services table starts indexing at 1 (not 0 like the Businesses API), I add +1 to the business index before passing it to the Services API.

    So, I’m basically saying:

    For business index 0 → fetch services with index 1,
    For business index 1 → fetch services with index 2, and so on.
    I know this isn’t great because if a business or service gets deleted, the indices won’t match anymore, and everything breaks. 😅 But it was just a quick way to test the setup.

    In the future, I’ll switch to using a unique identifier (like business ID) instead of the index so it’s more stable and doesn’t depend on the order. Let me know if you spot something else I should fix!
    image.png
    image.png
    image.png
    image.png
    image.png
    image.png
    image.png
  • /attachments/1326318360509550654/1328366989265080330/image.png

    vanishklift

    1 day ago

    this ?
    image.png
  • image.png
  • this are the headers for the services api (above)
  • unicodes

    1 day ago

    Can you please go on your right panel (On Load") and add Log to Console, and in data adding your api call for services (please select Services API then data) and try to see what it shows in Console on Chrome.
  • unicodes

    1 day ago

    In services Parameters please try to add formula - concatenate on position 1 "eq." on position 2 "1" or your business value.
  • /attachments/1326318360509550654/1328369557211185152/image.png

    vanishklift

    1 day ago

    image.png
  • /attachments/1326318360509550654/1328370096338636800/Screenshot_2025-01-13_at_16.28.08.png

    unicodes

    1 day ago

    "On Load" you have selected like this?
    Screenshot_2025-01-13_at_16.28.08.png
  • /attachments/1326318360509550654/1328370213116182569/image.png

    vanishklift

    1 day ago

    sure
    image.png
  • vanishklift

    1 day ago

    dont get this part tho
  • image.png
  • /attachments/1326318360509550654/1328370453152268439/Screenshot_2025-01-13_at_16.29.41.png

    unicodes

    1 day ago

    try like this
    Screenshot_2025-01-13_at_16.29.41.png
  • /attachments/1326318360509550654/1328370769222303817/image.png

    vanishklift

    1 day ago

    i did
    image.png
  • image.png
  • gives me 0
  • and in toddle the services vansih
  • image.png
  • /attachments/1326318360509550654/1328371016191311902/Screenshot_2025-01-13_at_16.31.13.png

    unicodes

    1 day ago

    I'm not familiar with xano at all, but usually you need Headers like Content type, or Authorization if it is private (your is public as I noticed from screen).
    Screenshot_2025-01-13_at_16.31.13.png
  • vanishklift

    1 day ago

    yeah Im public because these data is for non users
  • Tod

    1 day ago

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

    1 day ago

    as I understood i only need those for auth n stuff, but im also very new to this
  • unicodes

    1 day ago

    try content type
  • vanishklift

    1 day ago

    i can delete the eq. now right?+
  • unicodes

    1 day ago

    If it doesn't work anymore yes, please delete, but usually you need it for making the API know if the value you provide should be equal, or gr. (greater, etc). In supabase is mandatory.
  • Please do one more thing, in businesses success, call the services
  • vanishklift

    1 day ago

    I see
  • unicodes

    1 day ago

    and switch off autofetch on services
  • vanishklift

    1 day ago

    still null on console log
  • but in toddle it works fine
  • vanishklift

    1 day ago

    thit that too
  • did*
  • thanks for that advice already seems logic
  • unicodes

    1 day ago

    regarding the business selection, it pass most probably null in input and not 0 or 1
  • can you please console log just that value?
  • vanishklift

    1 day ago

    the inputvalue ?
  • unicodes

    1 day ago

    yes
  • Screenshot_2025-01-13_at_16.39.14.png
  • here, most probably it doesn't get 1 on chrome, but for some sistuation on test mode it gets 1.
  • screen also how you get that value "1".
  • vanishklift

    1 day ago

    i think i found the problem
  • as you are saying
  • it gets null
  • i switchet to string
  • instead of number
  • it gets 1
  • unicodes

    1 day ago

    Nice!
  • vanishklift

    1 day ago

    now i try to give it as a string to the api
  • unicodes

    1 day ago

    do you use index for selecting services based on business id?
  • vanishklift

    1 day ago

    yes currently
  • I know not good but was for tetsing porpuse only
  • I checked manually the forst business is 0 an the services start at 1
  • sorry
  • the businesses start at 1 and the index at 0
  • unicodes

    1 day ago

    Ok, make sure to pass the right value, you can try to add just a manual value for seeing if works on chrome, then try to get the right value from business id
  • vanishklift

    1 day ago

    still doesnt work even with manually inputtet data
  • soory
  • sorry
  • it work swith manually inputet data
  • but as an integer
  • and string
  • I will be back in an hour I have to go to a metting, Thank you already for your time !! appreciate it
    ❤️1
  • vanishklift

    1 day ago

    it seems that the Index I got from toddle of the database was a string, I added the +1 to a string so it was always null
  • "in Chrome"
  • but why did it work in Toddle without changing it to an Integer?
  • unicodes

    1 day ago

    I do not know. I'm happy you found the issue and you fixed 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.