Using truncate & split by to extract data from text
In this Bubble tutorial we demonstrate how text can be extracted and manipluated using truncate and split by in the Bubble app builder editor.
Unlock the power of text manipulation: Learn how to extract, truncate, and split data in Bubble with ease!
Master string data manipulation: Discover how to use truncate and split functions to format user input effortlessly.
Transform long text into usable data: See how to extract first names, last names, and more using Bubble's powerful string functions!
Extracting Data from Text with Truncate and Split By Functions
In this quick video, I will show you how to use the truncate and the split by functions in Bubble to extract and manipulate a longer string of text. I have an input field here with a long string of text and here are just some of the ways that I can extract different bits of data from it.
Using Truncate Function
I have a text field down here and I'm going to say input A's value and then let's say I just want the first 12 characters so I can use the truncate to 12 and then if I hit preview it will show me the first 12 characters. Now what if I wanted to do that from the end? Well Bubble also has a truncated from end which if I refresh now we just get the last 12 characters. If I go back to truncated from the start truncated 2 and refresh we'll see that this isn't so perfect because it's quite brutal to count by characters.
Using Split By Function
So what if I wanted to extract the first three words? Well, that's when I can use split by. Split by creates a list type in Bubble so if I say split by space and then I say items until 3 and then join with well let me just show you what this would look like to start with. This will list out the first three words but by default Bubble puts a comma between each one. In order to get rid of that comma I can use the join with space. So there we go I now have the first three words and if I wanted the first four words okay I can get the first four words.
Practical Applications
Those are just a couple of really handy tricks for reformatting the text data that your users may be putting into your app in order to get them in the format that you want. One example and this isn't going to be perfect would be first names and last names. I say it's not perfect because some people may have like a shorter yeah so they might have a shorter word in the middle like a muck for example followed by their surname but let me show you how this would work really well with first names and last names.
Extracting First and Last Names
So think of a first name last name I'll just put Tony Stark. So how would I extract just the first name? Well I can go with the split by a space and then I can just say first item and then if I wanted the last name I can go for last item. There you go that's just one example of how these little tricks knowing how to manipulate string data in Bubble can be really helpful.
Get the Complete Bundle for Just $99
Access 3 courses, 390+ tutorials, and a vibrant community to support every step of your app-building journey.
Start building with total confidence
No more delays. With 30+ hours of expert content, you’ll have the insights needed to build effectively.
Find every solution in one place
No more searching across platforms for tutorials. Our bundle has everything you need, with 390+ videos covering every feature and technique.
Dive deep into every detail
Get beyond the basics with comprehensive, in-depth courses & no code tutorials that empower you to create a feature-rich, professional app.
Save over 70%!
Valued at $80
Valued at $85
Valued at $30
Valued at $110
Valued at $45
Can't find what you're looking for?
Search our 300+ Bubble tutorial videos. Start learning no code today!
Have questions?
We have answers!
Find answers to common questions about our membership plans, programs, and more.
We're here to help you launch your no code SaaS. Reach out to the team and we'll double check our vast library for useful content. We'll advise you on how we'd tackle the same problem and there's a good chance we'll record the video to help the wider community.
As a Planet No Code member, you'll receive a discount on our Bubble coaching sessions. Monthly members receive a 10% discount, while Annual members receive a 17.5% discount. To redeem your discount, simply log into your account and book a coaching session through our platform.
Our 8-week intensive mentorship program is designed to provide personalized guidance and support to help you accelerate your startup journey. You'll be matched with a startup expert who will work with you one-on-one to set goals, overcome challenges, and make rapid progress.
To apply for the Mastery Program, simply click the "Request Invitation" button on our pricing page and fill out the application form. Our team will review your application and schedule a call with you to discuss your goals and determine if the program is a good fit for your needs.
We accept all major credit cards, including Visa, Mastercard, American Express, and Discover.
While we don't offer a free trial, we do provide a 14-day money-back guarantee. If you're not completely satisfied with your membership within the first 14 days, simply contact our support team, and we'll issue a full refund.