Splitting an html text (?)

Hi all, sorry for my english but i am using a translator.

I'm trying to figure out how to build an app to read data from a web page (then in the future I hope to be able to process it).

If I can, I can attach the block diagram that I copied/modified from a tutorial that was used for other things.

I have a web page that when called returns a response like: [699,0,-942,0,0]
what I would like to do is be able to separate the numbers...
With the Split-text function and setting the "," I managed to separate something but I can't separate all the numbers...

Am I doing everything wrong?
Is there another tool for what I want to do?
What I would need is both to display the numbers in windows, but also to simply process them, like if the last number is 0 do this otherwise that...

Can you give me a tip, just direct me so that I understand what I have to use to understand.

Thank you very much
bye Bye
Mauro

first remove the brackets, then use the split at block to split at , (comma) to get a list of your numbers, then just use the select list item block to select the 1st, 2nd etc. number

Taifun

Thanks for the reply.

I'd like to write to you that I understand.... but....
I don't understand which tools I have to take, what are they called exactly?

ps : treat me like a child, write me step by step what to do .... I have the good will to learn but unfortunately I'm not very familiar with these objects ....

thanks a lot anyway

start with the basics...

A very good way to learn App Inventor is to read the free Inventor's Manual here in the AI2 free online eBook App Inventor 2 Book: Create Your Own Android Apps ... the links are at the bottom of the Web page. The book 'teaches' users how to program with AI2 blocks.
There is a free programming course here Course In A Box and the aia files for the projects in the book are here: App Inventor 2 Book: Create Your Own Android Apps
How to do a lot of basic things with App Inventor are described here: How do you...? .

Also do the tutorials Tutorials for MIT App Inventor to learn the basics of App Inventor, then try something and follow the Top 5 Tips: How to learn App Inventor

Taifun


Trying to push the limits! Snippets, Tutorials and Extensions from Pura Vida Apps by icon24 Taifun.

and learn to debug your blocks

use Do it to debug your blocks, see also tip 4 here App Inventor: How to Learn | Pura Vida Apps
see also Live Development, Testing, and Debugging Tools
Taifun


Trying to push the limits! Snippets, Tutorials and Extensions from Pura Vida Apps by icon24 Taifun.

thanks, i will try.
bye Bye

Read the links Taifun gave you to learn more about App Inventor. Below is an example of what you want.

Thank you very much, you have been of great help to me... now I'm understanding the mechanism...

I know I have to study the book, my problem is time... I have very few free hours and that's why I've always learned by trying and trying again...

thanks again everyone

1 Like

Another way of doing it could be

1 Like

Another one, spot the differences :wink:

... or... :wink:

1 Like

Use the Web component's JsonTextDecode block to convert your string to a list, then select list items as required....

3 Likes

I don't think it's necessary or helpful to use an additional component for such a simple matter that also declares (possibly unnecessary) permissions in the Manifest.

that's why this block better to be a part of Dictionary or List or Text, rather than in Web component.

2 Likes

If aimed at my solution, the OP is already using a web component to get their web response, so logic follows to use the same component to decode the response. Most people would see that the string is a json array.

2 Likes

Ok, I didn't notice that.

wow! what a great team you are!! congratulations and thanks again!!!

After Peter's help I was able to divide the numbers as I hoped, and I was also able to assign each value to a variable.

Now I'm trying to figure out how to make the "label" change color if the value exceeds a certain threshold... but I haven't succeeded yet.... But for now I'm not asking for help :wink: I still want to try and try again :slight_smile: .

Do you know if there is a manual that explains a bit of everything about App Inventor, I mean a downloadable pdf from the internet?

Thanks again for the valuable advice!

ps : I will also try the other solutions after Peter's to see what result they lead to!

byebye from Italy and happy Sunday everyone!

Forgive me always my English as a translator :wink:

Sorry, I had already suggested Taifun where to find information "App Inventor 2 Book: Create Your Own Android Apps"