Dynamic Formatting Data from String

Hi, I have an app that receives a string via Bluetooth I need organized into an app based data table dynamically. The closest I’ve gotten is doing it like (notice GETSCHEDULES string is the command to send the data from device to the app):

This doesn’t really work as it only writes the first line item, and then when the button is pushed again it writes the the first line item on the 3rd row id. That makes sense since I assume ‘newline’ =/= next letter so letter 21+ is just returning a blank. I can fix that by just making the data a string with no new lines, and just a space or something else but its not worth it since this method requires me to manually code every piece of data to be organized. The max ‘Data Points’ my device is allowed to save/send is 99, and recoding this 99 times manually really seems like the wrong way to do this.

Here how a demo string is transmitted:
00,19:26,11.00,4.00,7.00
01,19:45,11.00,4.00,7.00
02,19:40,0.00,0.00,0.00
03,19:40,6.00,4.00,0.00
04,19:59,5.00,23.00,41.00

The idea for formatting is the first two numbers (00, 01, 02, etc.) is the event ID, and the rest of the number on the line are parameters for that event. The event is something handled on the device. The apps job is to be able to get this data from the device for the user to view, and then the user needs to be able to select it, and send a string with a command and the event ID back to the device to interact with it.

I’ve been playing with different blocks, watching youtube videos, and reading thunkable docs for the better part of 10 hours now, and I need some help figuring out how to format this data because my brain just isn’t coming up with the right answer. I can change the formatting of the data on the device side as well, I just cant figure out what to change it to to make it dynamic, and avoid having to manually code everything like is shown in my screenshot.

I really dont understand why somethign this simple doesn’t work:


of course it wont organize with the ID I want, but I don’t get why that only populates the first item of my test data set… :thinking:

The code behind the newline block is probably just \nand so your make list from text block is looking for that. Can you try other delimiters like an empty space or a comma and see if that returns something better?

1 Like

Hi Matt! Thank you for the suggestion. I’ve been working on debugging this, and yes tried new delimiters and that didn’t work. I’ve figured out the problem is actually thunkables MTU is set to 20bytes, so the data is being cut off on receipt by thunkable. I’ve verified the data is being sent/capable of being received by the phone in a different BT debugging app. I have my code set to an MTU of 247.

I’m having trouble figuring out how to set thunkable’s MTU… I dont see that anywhere in the BLE blocks… I’ll keep researching and update here if I figure it out, I’m 100% open to suggestions on better ways to do this too.

FYI if anyone finds this, I was never able to figure out how to get the MTU set higher in thunkable. I think that may need to be a feature request. Instead I made a packet ‘reassembly’ section to my blocks to work with the packet restriction of 20bytes.

I though BLE was tested only on Thunkable Live or Test Downloads? Computers don’t support Bluetooth (for obvious reasons).