Trying for a less cluttered list

I know this topic has been covered a multiplicity of times but do you think I can find the right example? Nope! Would someone with a few moments please point out the errors(s) of my way(s) regarding filtering a BLE list view. I woule be happy being directed to a (very) similar example somewhere on the Internet, as well.

Right now, when I start scanning, I receive every BLE address within reception range of my app. I would rather the list view display ONLY the MAC addresses with particular names in the second index. As you can see, I have that worked that out for the selection aspect but not the display aspect.

I am pretty certain that this is, again, much simpler than I am making it out to me. Thank you for reading this and for any assistance you may offer, as I have burned-out seeking a solution.

In the following list view, I would like only the first two to be visible.

You have to filter the ListView Elements upstream.

Show how you load the ListView Elements.

Do you mean like this (loading ListView elements)?

If so, would I replace my set ListView1 block et al with yours and add the funtion myElements? Actually, that was a rhetorical question because I'm a gonna try that. If you know this is wrong, I graciously accept pre-emptive correction. Thank you!

The myElements function is supposed to act as a filter.

I am not sure how ElementsFromString works better than Elements.
The BLE.DeviceList sounds like a list, from its name.

Try it, and worst comes to worst, check the tool tips for the fine print.

OK, I am super bonkers crazy confused! I can open the procedure envelope and create a procedure called myElements but where in the world and how did you get the "Elements" extension???

1 Like

This is called procedure and not a extension which is used to simplify the repetitive block's also to reduce the works

Read the parameters section of
http://www.appinventor.org/bookChapters/chapter21.pdf

There is no extension.

Procedure parameters are how you feed procedures data.

You add parameters to a procedure definition using its mutator button.

https://appinventor.mit.edu/explore/ai2/support/concepts/mutators

Greetings, and thanks for all the fish (paraphrasing Douglas Adams;). Here is the dynamic duo that made it all work, with appreciation for the procedure education. and ths myElements list eye-opener!


1 Like

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