Get Correct Index from Listview Selection after Filtering

Show listview.Selection
Run a Do It on split at spaces, what are you getting back?

Hi Tim,

Here you go :slight_smile:

After making a selection, please....

Oops sorry hahas

This is the result after I select Index 2:

OK, you should be able to see what is happening. You have a cell contains a phrase or sentence with spaces, these are also getting split up, and something odd happening towards the end! - therefore making a longer list than the one in global Tuiton_Jobs.

We need to think again.

Is there a unique column in your data e.g. Job Description - A,B,C,D that can be used ?

Each of my data do have a unique identifier (Job Reference ID):

image

OK

We make a list of those from the global Tuition Jobs list. These will have the same indexes. (although I see you have an empty cell ?)
We grab the Job Reference ID from the list selection - somehow....
Use that to find the correct index in the Job reference ID list, and then call back the data from the global Tuition Jobs List

Hi Tim,

By empty cell do you mean the gap between p_27442595 and x_53685437? If so, it's coz x_53685437 has a wider row height that's all hahas, there's no empty cell :slight_smile:

OK, believe I have cracked this one:

BLOCKS

In my example, the unique column is unq1,unq2....

On button click, we set the list from the csv, then extract the uniques to a separate list, finally setting the main list to the listview elements

After picking we find the index in the uniques list by using contains, then use that index to return the item in the main list

Hey Tim!

Can I check with you, for your initialise global mycsvtable to ".............", what should I put for mine? As mine is all within google spreadsheets initially

Just do what you were doing...

responseContent into list from csv table into variable global Tuiton_Jobs

Hey Tim,

These are my logic blocks:


Step 1: When I initialise this screen, this is what I see (no results):
image

Step 2: When click Seach (all three criteria empty):
image
^ Each of these items can be found in Call to Filter_None. Out of the 13 indexes in my google spreadsheet, I only selected indexes 6, 7, 8 and 11 to be shown after I click Search button.

Step 3: When I click on the element in the listview, this is what I see now:

Not sure where I'm doing wrongly :cry:

Edit:


image
image
^ My empty1.text shows me all the JRID

Building apps "backwards" never really goes well....

Suggest you simplify, remove all the additional filtering stuff, and get back to something that looks like my example, and get that working, then build up from there.

Guess that's something I gotta do :')

But thanks so much for your help Tim, learnt a lot and appreciate it!!

Hello gentlemen, did you manage to do something in this topic because I am struggling but nothing comes of it.

What, ListView filtering messing up SelectionIndex?

Add something to the end of each Element to allow unique identification by Selection.

I am trying to download only lines from a google sheet containing data entered in a text field, e.g. 1 or 2 or 3 or 4 and only those lines that contain one of these digits, but after filtering it loses index

See FAQ Section: Google Sheets
and look for how to add a filter to your query so Google Sheets filters for you.

believe me I've looked at this many times

The ai2-test.appinventor.mit.edu server might have some fixes for this.