How to separate the numbers from a text in a label?

I am making a Heath App and there in 1 screen there are 4 labels and in first 3 labels,there are text and numbers mixed both. So in the 4th label i want to display the sum of all the numbers given in the first 3 labels. But i can’t find any block in Thunkable X to separate all the letters from the labels and if i add all the labels with the text and numbers both,then it shows null.Kindly suggest me in this problem!! Screenshot 2020-12-29 152033|690x458 Screenshot 2020-12-29 152109|690x175

Getting those number out of the labels will be a challenge. There are ways parse the text of labels to find number, but they are all pretty brittle (ie if you change the text of the label, they number extraction code may break).

I would recommned you try storing the data in a JSON object, stored in a local variable. Then when a label is clicked, go back to the object and extract the data you need. Learning JSON is tough at first, but once you understand it, it will make complex data structures much more manageable. It looks like your project has mulitple local data sources, so you are probably already at the point where local tables are getting very complicated.

Let us know if you want any help getting started.

Happy THunking!

2 Likes

check this - Number Parser Tutorial

1 Like

I am sending the blocks that i have made.Kindly check it out.![2020-12-29 (4)|690x388]

well you just asked about getting numbers from it so i made it now how to do in your app you have to figure out on your own