# I need help making a census app and pet tracker

**URL:** <https://community.thunkable.com/t/i-need-help-making-a-census-app-and-pet-tracker/948549>\
**Category:** Questions about Thunkable X\
**Created:** [November 3, 2020, 6:55am UTC](https://community.thunkable.com/t/i-need-help-making-a-census-app-and-pet-tracker/948549 "2020-11-03T06:55:18Z")\
**Posts on this page:** 20\
**Page:** 5

<div class="post-metadata">

**Author:** ![codeswept](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/codeswept/32/87755_2.png) [@codeswept](https://community.thunkable.com/u/codeswept)\
**Post date:** [November 19, 2020, 5:31am UTC](https://community.thunkable.com/t/i-need-help-making-a-census-app-and-pet-tracker/948549/82 "2020-11-19T05:31:41Z")

</div>

Sure, thanks.

---

<div class="post-metadata">

**Author:** ![Michael\_Rogulla](https://avatars.discourse-cdn.com/v4/letter/m/ba8739/32.png) [@Michael\_Rogulla](https://community.thunkable.com/u/Michael_Rogulla)\
**Post date:** [November 20, 2020, 12:12am UTC](https://community.thunkable.com/t/i-need-help-making-a-census-app-and-pet-tracker/948549/83 "2020-11-20T00:12:17Z")

</div>

Hi @codeswept and all the others,

thanks for the hint pointing towards AIforEarth. I got my API key but I am still not able to get a species analysis. This is what I do so far:

- get a picture with my camera
- upload that picture to cloudinary. Cloudinary gives me a mediaURL.
- connect via Web\_API to AIforEarth with POST and giving the mediaURL as body. Is that correct? The documentation of AI for Earth is totally useless. I always get “500 - internal server error…”.

Has anybody had success in using AIforEarth, and if so, how?

I guess that the body of the POST message should contain the picture in base64 encoded, but in thunkable or cloudinary there is no base64 encoder.

---

<div class="post-metadata">

**Author:** ![tatiang](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/tatiang/32/55482_2.png) [@tatiang](https://community.thunkable.com/u/tatiang)\
**Post date:** [November 20, 2020, 12:27am UTC](https://community.thunkable.com/t/i-need-help-making-a-census-app-and-pet-tracker/948549/84 "2020-11-20T00:27:13Z")

</div>

@Michael_Rogulla I’m glad to hear someone else is trying this!

I got exactly as far as you did. I read through dozens of documentation pages and tried dozens of ways of POSTing an image url but I either get a 500 internal server error or I get an error about an unsupported media type. I even thought to try base64 but didn’t get anywhere with that (only a half-hearted try).

I’m really wondering if it can handle external urls at all. AI for Earth has a “blob” image server and it may be that the tool only works on images stored there. I sure hope not, though.

---

<div class="post-metadata">

**Author:** ![codeswept](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/codeswept/32/87755_2.png) [@codeswept](https://community.thunkable.com/u/codeswept)\
**Post date:** [November 20, 2020, 4:46am UTC](https://community.thunkable.com/t/i-need-help-making-a-census-app-and-pet-tracker/948549/85 "2020-11-20T04:46:55Z")

</div>

I haven’t even managed to add the API in my app. Still trying… Where can I get the API key from? I haven’t been able to understand anything from the documents you shared @tatiang.

---

<div class="post-metadata">

**Author:** ![tatiang](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/tatiang/32/55482_2.png) [@tatiang](https://community.thunkable.com/u/tatiang)\
**Post date:** [November 20, 2020, 5:13am UTC](https://community.thunkable.com/t/i-need-help-making-a-census-app-and-pet-tracker/948549/86 "2020-11-20T05:13:26Z")

</div>

As a teacher, I requested an API by clicking the “Request an API key” link at [AI for Earth Tech Resources - Microsoft AI](https://www.microsoft.com/en-us/ai/ai-for-earth-tech-resources).

 ![Screen Shot 2020-11-19 at 9.11.33 PM](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/2/2/222b3fe995b39b07d92d381667db07c43d29637e.png)

But even after several hours of trying, I wasn’t able to get the Web API call to work.

On the other hand, it’s really easy to get the built-in image recognition to work. It’s just not all that reliable or detailed (“dog” vs. “golden retriever”).

[https://docs.thunkable.com/image-recognizer](https://docs.thunkable.com/image-recognizer)

---

<div class="post-metadata">

**Author:** ![Michael\_Rogulla](https://avatars.discourse-cdn.com/v4/letter/m/ba8739/32.png) [@Michael\_Rogulla](https://community.thunkable.com/u/Michael_Rogulla)\
**Post date:** [November 20, 2020, 3:34pm UTC](https://community.thunkable.com/t/i-need-help-making-a-census-app-and-pet-tracker/948549/87 "2020-11-20T15:34:13Z")

</div>

Hi @codeswept , @tatiang and the others,

her is what I did:

- I requested an API key and got a link with login information for an AI4earth server
- there I could find my credentials under my user settings. It consists of two keys, a primary key and a secondary key. I could find no information what’s the difference.
- then I made a simple app in ThunkableX with a camera, a mediaDB (=Cloudinary) and a Web\_API component
- you need to configure the Web\_API component in designer mode like this:  
– the Web\_API URL should look like this: [https://aiforearth.azure-api.net/species-classification/v2.0/predict?topK=3&predictMode=classifyAndDetect](https://aiforearth.azure-api.net/species-classification/v2.0/predict?topK=3&predictMode=classifyAndDetect)  
– your API key goes here: enter " **Ocp-Apim-Subscription-Key** in Headers property, enter your primary key in “Value” and click on “Add”.
- the mediaDB must be configured with CloudName, APIkey and APIsecret from Cloudinary.  
– I am not sure but I hope to find a way that cloudinary delivers a base64 encoded image, otherwise we all need a Web-Service that converts a picture (from the cloudinary “mediaURL”) into a base64 encoded string. I think that’s the missing part in using AI4earth.

Here is how my blocks look like. I alway get “500 - internal server error blablabla…”. Maybe all will go well with base64 encoded pictures. I am also not sure how to enter the data into the body, maybe I have to use an object, or a JSON-String?

 ![grafik](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/c/9/c98908da3ae85fab1f1e3cf87f15ccb27154078d.png)

---

<div class="post-metadata">

**Author:** ![codeswept](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/codeswept/32/87755_2.png) [@codeswept](https://community.thunkable.com/u/codeswept)\
**Post date:** [November 20, 2020, 4:22pm UTC](https://community.thunkable.com/t/i-need-help-making-a-census-app-and-pet-tracker/948549/88 "2020-11-20T16:22:43Z")

</div>

That seems to be a lot of work… thanks for sharing that @Michael_Rogulla! I’m still trying to figure out how it works.

---

<div class="post-metadata">

**Author:** ![tatiang](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/tatiang/32/55482_2.png) [@tatiang](https://community.thunkable.com/u/tatiang)\
**Post date:** [November 20, 2020, 4:31pm UTC](https://community.thunkable.com/t/i-need-help-making-a-census-app-and-pet-tracker/948549/89 "2020-11-20T16:31:42Z")

</div>

@drted explains [here](http://community.thunkable.com/t/help-with-curl-notation-for-web-api-call/980758/5) that you have to use object blocks with the Web API “Body” block.

---

<div class="post-metadata">

**Author:** ![codeswept](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/codeswept/32/87755_2.png) [@codeswept](https://community.thunkable.com/u/codeswept)\
**Post date:** [November 23, 2020, 5:30am UTC](https://community.thunkable.com/t/i-need-help-making-a-census-app-and-pet-tracker/948549/90 "2020-11-23T05:30:11Z")

</div>

Hi!  
I am trying to add a ‘search’ option so users can only view reports of certain species, like if they search ‘cat’ then reports from ‘cat’ are supposed to come from Airtable. This is my code, that’s not working:

 ![Screen Shot 2020-11-23 at 10.58.37 AM](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/5/7/570cef0d39e850d6070ad82f1bbba1cd5923cd85.png)  
 ![Screen Shot 2020-11-23 at 10.59.00 AM](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/8/4/84c30a7f46606ff326f6c28aac5cb65423ff5660.png)  
Where have I gone wrong?  
Thanks in advance!

---

<div class="post-metadata">

**Author:** ![codeswept](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/codeswept/32/87755_2.png) [@codeswept](https://community.thunkable.com/u/codeswept)\
**Post date:** [November 23, 2020, 6:18am UTC](https://community.thunkable.com/t/i-need-help-making-a-census-app-and-pet-tracker/948549/91 "2020-11-23T06:18:33Z")

</div>

![Screen Shot 2020-11-23 at 11.48.00 AM](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/1/a/1aaf23baf46cfc0408824513edc23fa2d8c45e1f.jpeg)

---

<div class="post-metadata">

**Author:** ![tatiang](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/tatiang/32/55482_2.png) [@tatiang](https://community.thunkable.com/u/tatiang)\
**Post date:** [November 23, 2020, 6:24am UTC](https://community.thunkable.com/t/i-need-help-making-a-census-app-and-pet-tracker/948549/92 "2020-11-23T06:24:57Z")

</div>

Are the values in your “Recognizer tags” column Airtable row IDs? The way you have it set up is a little circular… it would help if you could show what your Airtable column headers and (a little bit of) data look like.

---

<div class="post-metadata">

**Author:** ![codeswept](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/codeswept/32/87755_2.png) [@codeswept](https://community.thunkable.com/u/codeswept)\
**Post date:** [November 23, 2020, 6:26am UTC](https://community.thunkable.com/t/i-need-help-making-a-census-app-and-pet-tracker/948549/93 "2020-11-23T06:26:04Z")

</div>

Sure

---

<div class="post-metadata">

**Author:** ![codeswept](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/codeswept/32/87755_2.png) [@codeswept](https://community.thunkable.com/u/codeswept)\
**Post date:** [November 23, 2020, 6:27am UTC](https://community.thunkable.com/t/i-need-help-making-a-census-app-and-pet-tracker/948549/94 "2020-11-23T06:27:07Z")

</div>

![Screen Shot 2020-11-23 at 11.56.11 AM](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/d/8/d8954411f30a56ad73127a55e0553a202785bb38.png)  
I have filled that in on Airtable, just for placeholders when there are no actual reports yet.

---

<div class="post-metadata">

**Author:** ![codeswept](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/codeswept/32/87755_2.png) [@codeswept](https://community.thunkable.com/u/codeswept)\
**Post date:** [November 23, 2020, 6:30am UTC](https://community.thunkable.com/t/i-need-help-making-a-census-app-and-pet-tracker/948549/95 "2020-11-23T06:30:51Z")

</div>

I have created a separate DataViewer List and hidden the first one for showing filtered reports.

---

<div class="post-metadata">

**Author:** ![tatiang](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/tatiang/32/55482_2.png) [@tatiang](https://community.thunkable.com/u/tatiang)\
**Post date:** [November 23, 2020, 6:37am UTC](https://community.thunkable.com/t/i-need-help-making-a-census-app-and-pet-tracker/948549/96 "2020-11-23T06:37:02Z")

</div>

When you loop through “for each item j in list,” you’re looping through the column values (#dog #blackandwhite, then #dog, then #cat, then #cow).

But your “if” block checks to see if the value in the “Recognizer tags” column for an Airtable row with “j” as the row ID is equal to the user’s input. Your Airtable is never going to have a row with row ID “#dog” for example. Row IDs are long strings of characters that look sort of like d4590ui18572m3.

To fix this part, replace the first “get value” block with just the “j” variable block. Because “j” already contains #dog #blackandwhite (for the first row, for example). You just need to see if “j” contains the text input.

---

<div class="post-metadata">

**Author:** ![codeswept](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/codeswept/32/87755_2.png) [@codeswept](https://community.thunkable.com/u/codeswept)\
**Post date:** [November 23, 2020, 6:56am UTC](https://community.thunkable.com/t/i-need-help-making-a-census-app-and-pet-tracker/948549/97 "2020-11-23T06:56:08Z")

</div>

Thank you. Very helpful

---

<div class="post-metadata">

**Author:** ![codeswept](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/codeswept/32/87755_2.png) [@codeswept](https://community.thunkable.com/u/codeswept)\
**Post date:** [November 23, 2020, 8:38am UTC](https://community.thunkable.com/t/i-need-help-making-a-census-app-and-pet-tracker/948549/98 "2020-11-23T08:38:23Z")

</div>

Sadly, it’s not appearing:

 ![Screen Shot 2020-11-23 at 2.07.15 PM](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/9/e/9e5378752af7b69f9350aefa751fd17d5aee5471.png)  
This is what it looks like after searching:  
 ![Screen Shot 2020-11-23 at 2.06.42 PM](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/b/b/bba4f47600fff8a49cc344633c8925a7753284b1.png)

---

<div class="post-metadata">

**Author:** ![tatiang](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/tatiang/32/55482_2.png) [@tatiang](https://community.thunkable.com/u/tatiang)\
**Post date:** [November 23, 2020, 5:16pm UTC](https://community.thunkable.com/t/i-need-help-making-a-census-app-and-pet-tracker/948549/99 "2020-11-23T17:16:39Z")

</div>

The value of the variable “j” is just the string “#dog” or whatever is in the Recognizer tags column in Airtable. You’re still using j as if it’s a row id. It’s not.

It’s like if I told you, can you go outside and grab “#dog” lemons from the tree? You’d have no idea how many to get. Or take the "#dog"th person in line and give them a prize. Which one? It’s not a row id or a number that is useful in this way.

The first step is to see if your IF condition is working. I would change the value of a label to “found” or something like that right below the “if” block. Since it’s in a loop, maybe add a vibrate block so you can tell if it works when tested on a mobile device. If you get confirmation that the IF condition is set up correctly, then move to figuring out how to display the related information.

You’ll need to know which row contained the tag inputted by the user. So you’ll probably want a counter variable that increments by one each time the “for each item j in list” loop iterates. That way, when you find a “j” that contains the tag, you’ll know what number row (in Airtable) it’s in.

---

<div class="post-metadata">

**Author:** ![tatiang](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/tatiang/32/55482_2.png) [@tatiang](https://community.thunkable.com/u/tatiang)\
**Post date:** [November 23, 2020, 5:19pm UTC](https://community.thunkable.com/t/i-need-help-making-a-census-app-and-pet-tracker/948549/100 "2020-11-23T17:19:44Z")

</div>

Here’s a video by @darren that demonstrates how to search and display data from Airtable:

[![](https://img.youtube.com/vi/V61Oo6TCwnw/maxresdefault.jpg "How to Get Data from AirTable and Display It In Your Thunkable App") ](https://www.youtube.com/watch?v=V61Oo6TCwnw)

Also, this set of blocks:

> [@Search for value in colum (Airtable Spreadsheet)](http://community.thunkable.com/t/search-for-value-in-colum-airtable-spreadsheet/56949/8):
>
> Sample [%D0%B8%D0%B7%D0%BE%D0%B1%D1%80%D0%B0%D0%B6%D0%B5%D0%BD%D0%B8%D0%B5]

---

<div class="post-metadata">

**Author:** ![codeswept](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/codeswept/32/87755_2.png) [@codeswept](https://community.thunkable.com/u/codeswept)\
**Post date:** [November 24, 2020, 4:08am UTC](https://community.thunkable.com/t/i-need-help-making-a-census-app-and-pet-tracker/948549/101 "2020-11-24T04:08:56Z")

</div>

Thanks so much! Will change the ‘j’.

[Previous page](https://community.thunkable.com/t/i-need-help-making-a-census-app-and-pet-tracker/948549.md?page=4)

[Next page](https://community.thunkable.com/t/i-need-help-making-a-census-app-and-pet-tracker/948549.md?page=6)
