In-Range BluetoothClient Device Name Filter

Hi, I am new to this app and I have a question:

Is it possible to filter a list of the in-range paired-bluetooth devices with the device names begin with "FFHBT" (case sensitive) ?

I have a simple block like this:


That block shows all of the paired devices and I cannot figure out how I can filter the list.

Thank you!

What does it do? Is it something like FFHBT-device etc? If so you can do this:

Say if you have the list:
FFHBT-device1
abc-device2
FFHBT-device3
random-123
FFHBT-device66
it should return ["FFHBT-device1", "FFHBT-device3", "FFHBT-device66"]

Then you can set that in the list picker.

1 Like

The advanced list blocks include a filter list block you can interpose into your Elements loading.

Thank you apsw! That makes sense. I will try and see how it goes.

Where can I read about advanced list blocks? I could not find it.

They are near the bottom of the built in list blocks pallet.

Hover to get tool tips.

I tried to make your blocks but I could not find some of them.

This is what I got:

Update:
Never mind, I found it. :slight_smile:

I changed my blocks following yours:


I run it on my phone and the list was empty. No device was shown.

When I changed back to my first blocks:


All of the paired devices are there including the ones with "FFHBT ..." names.

https://ai2.appinventor.mit.edu/reference/concepts/pholo.html#filter

1 Like

So show us your entire list of devices.

With these blocks


I receive

With these


I receive

Update:
Looking at this again I might know what the problem is. The index for the "select list item" might need to have a value of 2 instead of 1.

Yes! I got it!

Thank you everyone! :heart:

Thank you! This solves part of my problem.

How do I list only the devices in range?

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