Hello everyone,
I'm working on an app using MIT App Inventor and need some help with a specific task. I'm receiving responses from an AI, and some of these responses contain a special tag: (saved|some text to save|). I need to figure out how to extract the text between the vertical bars (|) and save it to a TinyDB.
For example, if the AI response is "Your settings have been updated (saved|user_settings|)", I want to save "user_settings" in my TinyDB.
I've been trying to use the split text at block, but I'm having trouble with the correct logic to handle as I am new. Any guidance or a simple example of the block sequence would be greatly appreciated!
Thanks in advance for your help!
This is a two stage split, known on this board as the Taifun Split Procedure.
Send the web response content through a Text Split At '(saved|' block.
This gives you a list, with item 2 holding what you want followed by garbage.
Send item 2 through another Text Split At '|)' block to get another list.
Item 1 has what you want.
2 Likes
Thanks so much for the detailed and easy-to-understand explanation of the Taifun Split Procedure. It was incredibly helpful and solved my problem!
1 Like