CloudDB outputing all values instead of the image pressed before

What I want is that the image clicked before hand then only setes the text to THAT value clicked, instead of all the values.
Image 1


Code for Image 1:

Image 2


Code for Image 2:

Image 3


Code for Image 3:

This textbox went through all the get values and stopped at whatever one I put last:

I understand it's because I put all the "get values" there, but I'm not sure how to make it so ONLY the button clicked displays in the textbox.

Here is the AIA:

Les_Envies (1).aia (2.0 MB)

Please provide examples with your answers to help me understand better. Thanks ! :slight_smile:

Maybe it is because of

2 Likes

I did notice 2 inaccuracies in your code; both being in the CloudDB.gotValue event block:

  1. The if-else if blocks you're using do nothing; removing them should change nothing.
  2. The Notifier.ShowAlert block should only be called when private value = 0, or else it'd be called everytime the user picks an item.

Edit: the count has raised to three; see the post below this one.

1 Like

Also, look at this block (taken from your images):

image

In here, value can never be equal to a Savoury Dinner, because "value" refers to a list, and "Savoury Dinner" is a string.

1 Like

See your previous Topic Tasha, I have uploaded a better example (My last post at the bottom of the Topic).

Would I need to change it to a list name?

Thank you so much ! But I in the end decided to go for your first example, as looks and acts how I want it to.

All good :grin:

I don't quite understand why the if-else blocks aren't working. I have tags that equal to those strings:


How do you propose I fix this so that the image the user clicks before is shown, not everything.

No, you can leave it there, but compare it in with a list, not a text block.

Could you give me an example please?
All my values have been stored in a cloud DB. I think it would be easier to understand if you could by chance show me what you mean?

Hi Tasha

Snap052

This procedure is off - it should only be uploading to CloudDB1? Have a separate Procedure to download.

Now, an issue for those of us trying to help is we don't understand what the App is supposed to do! We do know the User selects a craving for each meal time and that data is uploaded to the Cloud.

We don't know why the same App would download that data, or is it a seperate App doing this?
Plus:
a) What exactly is supposed to happen to initiate the download?
b) Once downloaded, what is supposed to happen with the data?

If you could draw a schematic of the process, that would help enormously.

Maybe I got confused.
If I don't do getData, then this doesn't work:

The app downloads the data so that it can remember if the user clicks i.e breakfast, spicy craving, 20 min (time will be allocated later) and then it would display only THOSE recipes.

Schematic of the process:

question a: App inventor is supposed to remember it. I'm just testing to see if it works atm with the clickable button so that I can use it later.

Question B: answered in the image above.

Does it make more sense?

It doesn't make sense to upload data and then immediately download it - you already have the data in the App before the upload. I thought your App was performing a survey where several people would upload their data and later someone would analyse it. :thinking:

If it's not for something like that, but the data needs to be stored for recovery at a later time, save it on the phone in TinyDb.

1 Like

So the Users initial choices would be made, then the App presents what is available - re your example, Breakfast, Salty, 20 minutes. Up to this point, no User data needs to be saved. What does need to be saved (for access by the chef?) is the User's selection from the list of Breakfast, Salty, 20 minutes meals.

Oh ! I see. I understand now - I got confused. oops.. I'll redo it with TinyDB and see how it goes ! Thank you so much !

Just double checking for future purposes, I'm still using CloudDB for a Register/login system as I want the users to be able to save their favourite recipes for later.

That still doesn't need CloudDb, it can just be stored on their phone, the advantage being that the App will work interdependently of the internet and so be more reliable.

But when the user logs in again will the "saved recipes" still be there with TinyDB?

Yes - it works the same as CloudDb (CloudDb was based on TinyDb).

Note, you don't need to save images in the Db - they are already on the device (in your App?). You just need to save the filename so that the image can be loaded.