# Filter and connect to a specific Bluetooth device from the List Viewer

**URL:** https://community.thunkable.com/t/filter-and-connect-to-a-specific-bluetooth-device-from-the-list-viewer/2476943
**Category:** BLE / BlueTooth
**Tags:** design, listview, bluetooth, help, listviewer
**Created:** [June 21, 2023, 3:55pm UTC](https://community.thunkable.com/t/filter-and-connect-to-a-specific-bluetooth-device-from-the-list-viewer/2476943 "2023-06-21T15:55:34Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![thunkable28](https://avatars.discourse-cdn.com/v4/letter/t/a9a28c/32.png) [@thunkable28](https://community.thunkable.com/u/thunkable28)
#### Post date: [June 21, 2023, 3:55pm UTC](https://community.thunkable.com/t/filter-and-connect-to-a-specific-bluetooth-device-from-the-list-viewer/2476943/1 "2023-06-21T15:55:34Z")

</div>

Hello Thunkable community,  
I am working on a BLE app where the App first scans for all the discoverable devices and then user connects to a specific device from the ListViewer. The block implementation to discover the BLE devices is shown below:

 ![Screenshot 2023-06-21 at 10.42.48 AM](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/2/0/2096a2eb39deada65592866295e29127939b7345.png)

On the App side, this is how the BLE devices are displayed for user selection:

 ![IMG_0782](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/0/e/0e792d106c7c2a56a0bcbc90ad4db145e9314756.png)

So far so good. However to make user experience better, I would like to filter the devices and only display device with specific names only, preferably filtering a prefix, rather than user scrolling and looking for a specific device in the long list.

For instance, using the list above, scan all the devices, however, only display devices starting with prefix “ **MFLD\_** ” and “ **DEVID\_** ”.

Is it possible to do such filtering using blocks in Thunkable and I would appreciate if someone could provide the block snippet as to how to achieve this.

Thanks in advance. Cheers!

---

<div class="post-metadata">

### Author: ![thunkable28](https://avatars.discourse-cdn.com/v4/letter/t/a9a28c/32.png) [@thunkable28](https://community.thunkable.com/u/thunkable28)
#### Post date: [June 21, 2023, 9:57pm UTC](https://community.thunkable.com/t/filter-and-connect-to-a-specific-bluetooth-device-from-the-list-viewer/2476943/2 "2023-06-21T21:57:26Z")

</div>

@ioannis, maybe you can shed some light on this one? I really need some assistance here!

Thanks

---

<div class="post-metadata">

### Author: ![ioannis](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/ioannis/32/146956_2.png) [@ioannis](https://community.thunkable.com/u/ioannis)
#### Post date: [June 22, 2023, 3:54pm UTC](https://community.thunkable.com/t/filter-and-connect-to-a-specific-bluetooth-device-from-the-list-viewer/2476943/3 "2023-06-22T15:54:44Z")

</div>

Hello @thunkable28  
Yes, it is possible to filter the data you show on the list view  
You will need to add a condition before you insert a device into the list  
To create the condition you could use the [“does string contains” block](https://docs.thunkable.com/text#does-string-contain)

---

<div class="post-metadata">

### Author: ![thunkable28](https://avatars.discourse-cdn.com/v4/letter/t/a9a28c/32.png) [@thunkable28](https://community.thunkable.com/u/thunkable28)
#### Post date: [June 22, 2023, 4:31pm UTC](https://community.thunkable.com/t/filter-and-connect-to-a-specific-bluetooth-device-from-the-list-viewer/2476943/4 "2023-06-22T16:31:10Z")

</div>

Thanks alot, @ioannis,  
Just wanted to share with the community how I made filtering work with the List Viewer block and the [“does string contains” block](https://docs.thunkable.com/text#does-string-contain).

 ![Screenshot 2023-06-22 at 11.27.44 AM](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/d/a/da3ff63f831cb2c7ab152db80dbe38a0542bcfdd.png)

Now I only see the devices I want to in the List Viewer which is awesome.  
Hopefully, others will find this resourceful.

Cheers

---

<div class="post-metadata">

### Author: ![thermoman1510p3](https://avatars.discourse-cdn.com/v4/letter/t/94ad74/32.png) [@thermoman1510p3](https://community.thunkable.com/u/thermoman1510p3)
#### Post date: [September 6, 2024, 9:31pm UTC](https://community.thunkable.com/t/filter-and-connect-to-a-specific-bluetooth-device-from-the-list-viewer/2476943/6 "2024-09-06T21:31:21Z")

</div>

Hi! Great work! I’m curious what your variable is, as I’m trying to do the same thing and I want to get it right!!

Thanks!

---

<div class="post-metadata">

### Author: ![ioannis](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/ioannis/32/146956_2.png) [@ioannis](https://community.thunkable.com/u/ioannis)
#### Post date: [November 8, 2024, 1:33pm UTC](https://community.thunkable.com/t/filter-and-connect-to-a-specific-bluetooth-device-from-the-list-viewer/2476943/7 "2024-11-08T13:33:45Z")

</div>


