Thanks for the answer and project.
Is there any possibility to search for an other city for example vienna or graz … to get the actual “Warnstufe”.
kindly regards again
If you’re going to get different data from a JSON file, you really need to understand how they work. I won’t be able to make a demo for each value you need.
There are many tutorials available (I Googled thunkable json).
If you are having trouble with something, post a screenshot of your blocks and someone can help you.
Thanks for your answer.
In my opionion I will need a loop for the name label to change the 2 in an index beginning with 1 to 2095 to search for a special name.
How familiar are you with Thunkable? Which loops blocks have you tried already? I think you’re going to need to use the Count from 1 to length(list) by 1 block.
That’s a good start! I’m trying to publish some changes I made to what you posted but the publishing server doesn’t seem to be working for me. It just says “Processing…”
Some things I noticed about your blocks:
You have “If Status=200” twice. I guess I had that in the original project too. Oops! You only need it once.
In your count with i from 1 to 2095 loop, you’re getting the property of list item # app nr but there’s a good chance that app nr will be zero/null many times in that loop. So you need to check to see if app nr ≠ 0 first and then change the label text if it’s not zero. That’s what I was trying to fix and publish to show you.
The from JSON Status label set Text to Done block should be at the end of the If status=200 section not below it. That was my fault, too!
If you know there is only one name that matches your search (“Weiz”), you can make this much faster by adding a break out of loop block from the Control drawer right after the set app nr to i block. So if the JSON record with the name “Weiz” is #15 out of 2095, it will stop when it finds it. In that case, only 15 loop cycles/iterations will have completed instead of the total 2095.
Thanks a lot for your answer.
I want to upgrade this project and try to change the background-color of the warntufe label regarding to the value.
I try the following after web_api get:
But when the warnstufe text is 4 the background color will not change to blue.
Hope somebody can still help me there.
kindly regards
You need to put the if/do block INSIDE of the Web API blocks’ “then do” section.
The way you have it set up is like telling a kid these three things:
“Tell me your name.”
“Solve 18 * 45 * 3 in your head.”
“What’s your favorite color?”
Because they are going to take a while to solve #2, they will probably tell you their name first, then their favorite color, and finally the answer to the math problem.
Web API calls take a little time. But the compiler is going to go right past to the next statement (if/do) unless you either make it wait or you put it inside the “then do” section of the Web API block.