Ask for text by a press of a Button. Get number values of it

Hello everyone! I'm trying to create an app that is needed to insert names and each one individually has numbers after it, sort of like "Angelo 250". The information will be displayed on a ListView, I need to save the name plus the numbers, in another screen when they press "Angelo 250" and "Maria 300" It will sum 250+300. Can anyone help me out with this?

Would really appreciate the help :slight_smile:

Welcome to community. What have you tried so far ? How do you assign numbers to names ?

Hello thank you so much for the welcomes :slight_smile:

I haven't tried it yet but this is what I pretend to get:
I create list with some food names and the respective calorie value ->


After doing it, in other Screen it will also display the same in a different ListView where if I press the product, I get only the calorie value to do a sum of total calories (calorie + calorie = totalcalories)

This is what I coded for now in the the First printscreen I sent.

I'm just stuck and don't know what method to use and how to only get the value of the calories to do a sum.

Hope I explained myself well, it's my first time asking for help in a community and I really hope someone could help me out :grin:

save the name in a list and number in another list.
or, save them in a list of list

Dictionary can be used, where product as key and calorie as value. Since here product is unique as key would be and values/calories can be different or maybe same.

OR by using check box, as shown below

Once you are ready with the final selection you can look up into dictionary get the values/calories correspondingly to sum up.

Here is a sample for you to study, using multiple TinyDB NameSpaces as dictionaries ...

Currently studying it, this was really helpful. Thank you so much!

Hello Miguel, You might like to make your Second Screen a 'Virtual' Screen:

When we define virtual screens, we use one 'real' App Inventor Screen (most often Screen1). Screen-sized Vertical Arrangements on it are displayed/hidden as required - they are the Virtual Screens. This is generally a better approach for multi-screen Apps, they share data without having to "pass" it between screens and it also reduces code duplication, making the App more efficient and the code easier to follow if you have to return to it at a later date.

So, instead of separate "houses", virtual screens are "rooms" of the same "house".

For a Screenshot of your Blocks:
Right-mouse in the Blocks work area and select "Download Blocks as image"