List view with details shown in notification


i am having alist view consist of course code and i want when i select any one the elements from this list the course name appears after selecting the element (note : i have a api each course with its related name and the list view appears correctly with course code ) .. i am try to store selection in variable and when i click on element of the list the name will appears but itdoesnt success any heeelp :frowning: ...... all i want in summary when i click on any one of the elements which contain the course code it`s name will appear in notification

image

You do not appear to be adding the course name to your listview elements ?

If you did, thenyou need to extract the course name from the listview selection then use text blocks to do this.
(you do not show a listview selection, so difficult to advise...)

sorry i can`t understand what you meaning ...
all i want is the course name to be appeared when clicking on the course code from listview element is there any way to make that?

Show the output of listview.selection, and indicate which part you require.

Also show the content of your courses list, and indicate which item is the course name.

Use Do it

Use the companion app and 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.


the course code appears already in list view >> i want when pressing on any one of themto get the value of that`s code which will be the course name from the api

when i doing what you mentioned for ... when i press on any of listview elements the same course code elements appears again ... all i wantwhen press on code fetch the name (all that keys and values from api)

This post was flagged by the community and is temporarily hidden.

let me explain to you from scratch :slight_smile:
i have json file from api :
[
{
"course_ID": "",
"course_Name": "اOSA"
},
{
"course_ID": "",
"course_Name": "اBA"
}
]

i want elements to be appeared only the course code .
but the course name will be appeared when i select the element . plz i need ahelp...... i succefully appears the course code >> but i dont know how to make when pressing on any element its related name will appeared demand on json file

>>>

But your course codes are empty!

I know ... it's value will be added later with apu

You will need to use the ListView's SelectionIndex to look up the information you want from the place where you loaded the Elements for that ListView.

I hope you kept it.

What are the blocks for doing what you meam?

Get your course code data included first

Use your listview.selectionIndex block to return the index of the listview elements, then you can use this to display the course name associated with that index.

Start by showing the blocks where you load the Elements of the ListView,

Can you make what you mean in blocks to understand you plz

[
{
"course_ID": "1",
"course_Name": "IOSA"
},
{
"course_ID": "2",
"course_Name": "IBA"
}
]


1 Like

really thank you reallly ... :heart_eyes: .....and another question later if i have 3 keys in json file (adding to name and code the content for example ) which part will be added to your solution ?

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.