So even if everything goes right with your blocks, you’ll still get an error.
You’re calling it the “foodish api” which at first confused me. The API you are accessing is the Airtable API. I understand that your table is named Foodish.csv but that doesn’t make it an API. It’s simply data accessed from the Airtable API.
When you have a problem with your blocks, you need to simplify and test. There are so many possible reasons this might be working that the first step should be:
Can you get any data from Airtable? For example, what happens if you set a label’s text to get property "DishName" of object in list [rows] get #2? Does that work? What value do you see in the label?
If you cannot get any data from Airtable, the next step is to check the error it returns. It sounds like you did that and saw “Could not find table Foodish.csv in application”. So even though you say your Airtable credentials are correct, I don’t think they are. Double-check them again. Also try to connect to a different Airtable table and see if that works. More importantly, why are you using a Web API block to connect to Airtable? You can just use the Data Source blocks (Get Value, Get Row Object, List of Values) and it’s much easier. For example, to get a random DishName, you would just replace the entire get property of object block with this block:
And actually, all of the blocks in your screenshot could be replaced with just set ImageDisplay's Picture to [random item of list [list of values in (Data Source)]].
For now, remove the API from the equation. What happens if you make it so that when the screen opens, you set ImageDisplay’s Picture to “https://foodish-api.herokuapp.com/images/pizza/pizza26.jpg”? What appears? Because like I said, even if everything goes right with your blocks and you get the value “pizza/pizza26.jpg” from the Airtable API, you’re still going to see an error.
So you’ve told me that you can’t get any data from Airtable using the API. So you either need to fix the authentication, try another table from Airtable, or just scrap the API like I suggested and use Data Source blocks.
No, the blocks are incorrect. What I meant was to join the url with random item of list [list of values (Data Source name)]. You can see an example of the List of Values block in this section of the documentation: Data Sources - Thunkable Docs.
As I said, if the 3rd step doesn’t work then you have a problem with that website. I now see that you are using the Foodish API as well as the Airtable API. Can you post an example of a working image url from the Foodish API? Even a sample one from their documentation would be fine.
Edit: the Foodish API site is down. I can’t even get to their base url: https://foodish-api.herokuapp.com. You’ll need to use something else or contact them to find out why it isn’t working. This has nothing to do with Thunkable.
I also realized that the error meant it cannot access the Airtable database. But yes, you could be right with the Foodish API, I have seen other people have problems (like Server down? · Issue #16 · surhud004/Foodish · GitHub). It could be down .
But adding a data source instead of airtable component makes it unable to select my database name “Foodish.csv”. And can you please show me how the random item of list [list of values (Data Source name)] looks like in blocks?
Edit: not to mention that I didn’t create the API, so I will have to notify the team or check with the one of the people who manages the api.
Are you needing to get data from more than one table in Airtable? Because the Data Source blocks work great if you only have one table that you’re using. The documentation shows how to add an Airtable database (table) to a project: Data Sources - Thunkable Docs.
In that example, I’m getting the full column called “Photo” from the Airtable database called “Quotes & Photos”. I’m then taking that list of row values (from the column) and getting a random item from it. And finally, I’m setting the image’s picture to that random item value.