How do I resolve this error? Select list item cannot accept the arguments

Hello, I'm trying to create a profile system where user can upload their photo. But i Encounter this error message. I don't know how to resolve this.

I don't know where's the error is I tried to rebuild it but still nothing. or there's a block i used that should not been there?

Here's my blocks:

Check the content of UserPic...you are trying yo get the element 2 from it.

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.

What im trying to do is, when user login then go to profile the system should check the username then get the picture that been uploaded by the user that have same index of his username. but i think that's not what happening.

Check how many elements you have in UserPic... because it seems you are trying to get the element 2, but USerPic has only one.

Anyway, there is something weird..."Name.Text" is the name of the username? you are trying to compare the username with an element from UserPic? and other wrong thing...you are trying to place the complete list UserPic into a Image.Picture (well, really on two).

I already resolve the problem. but another one came up after user upload or user login. They can't see the image or it's not loading.

Here the result.

what do you want to do with all those "compare texts" blocks?

"Index in list" gives you a number (the index of the element in the list) and you are comparing that number with the UserPic list? what do you want do do with that?

And when setting the images, you do the same ? Here I suppose you have to select an item from UserPic (the element with the same index of the user).

What i wanted to do here is to check if the picture of the same index of user have data, then if true then it would change the button on the user screen it would be "change profile button" instead of "upload profile button".

Here Im trying to get the picture that have a same index of username in the UserPic to display it on image.picture

But it seems that I did something wrong in blocks, even when I try the "Do it" it didn't show me any error but intead it showing my that it's displaying the image.

It seems you have three paired lists...if a user has not picture , then what there is for that user in the UserPic list? an empty element? How do you know if the user has not a Picture?

You appear to be comparing an index with a list ?

image

Supposing you have three paired lists stored in tinyDB, and once you have recovered them, it would be something like this:

Yes, since im trying to get the picture that have a same index of username in the UserPic

How will an integer (e.g. 1, 2 or 3) ever equate to a list (e.g. ["1","2","3"] ) ?

e.g. if 1 = ["1","2","3"]

I tried this and it work. Now my only problem is when user still didn't have saved photo in database it is showing an error message. and the change profile button how can I replace the existing picture in the system, like deleting the previous save then replace it with the current upload.

This is the error I'm getting:

image

Here's my block for change picture: Question: Do i need to save picture when i change the profile or this blocks would do the change in the database?

Here's my block when initializing the screen:

If you are going to handle three paired lists, you need have always the same number of elements in the three lists so, if any user doesn't enter the photo, you need to place a default value instead (you can use a default photo). Then, you can only replace the item if the user want to change it.

How can I do that? I mean save the default image as user create their account. like when user just create account then that would only time the default image would be save in db and display it on screen, then change it. or do I need to manually set the default value in the list?

I don't know how are you creating the three paired lists and storing them, but you need to have the same number of elements in the three lists to do this work.
You can have a "default.png" and if the user doesn't enter a photo, you can add it to the list.