Dear community, I am relatively new to bubble and creating an App that calls the ChatGPT API to iterate travel ideas. The API response is a string, that separates the fields by “;”. In Bubble, I am splitting the text by that operator and this works perfectly fine. However, in order to format each column separately, I created three text fields (for each column one). My issue is the following:
However, i would like to have everything on the same line. Spent hours experimenting with Find&Replace, nested operations, Regex, but I just don’t know anymore how to proceed.
Wow! That’s a mess!! (if it wasn’t for the extra : where it says the price it would be very simple)…
Will the price field always contain the colon? Or does that depend on the response? And will the words used always be either Cost or Fee? (if yes then the solution is not too hard)
I was only talking about the : inside the price field (not the ones that split the items… you need those)
If you’re able to determine the format of the API response, keep it as you originally had it (Day and Time;Activity;Cost:) but just make sure there aren’t any additional : in the texts (like there were before)… or use a different symbol in the Cost field etc.
Then it’s simple…
Just split the overall text by : for the RG datasource
Then just split each text by ; inside the cell and display items 1, 2, and 3 accordingly.
Might be a silly question, but how does “Then just split each text by ; inside the cell and display items 1, 2, and 3 accordingly.” work?
I have three text fields (one for each column) in the RG to have unique formatting per column (e.g. cost column should be narrow, Activity should be wide). How can I achieve that?
Day and Time;Activity;Cost:08.00am;Start your journey...;Train ticket cost 30CHF:10.00am;Arrive in Berne......;Park admision fee 8CHF:12.00pm;Continue your expl...;Lunch cost 25 CHF:02.00pm;From here, take a ...;Admission Fee 20 CHF
Split that by :
That will give you a list of texts (which you’ll use as the data source of your RG):
Day and Time;Activity;Cost 08.00am;Start your journey...;Train ticket cost 30CHF 10.00am;Arrive in Berne......;Park admision fee 8CHF 12.00pm;Continue your expl...;Lunch cost 25 CHF 02.00pm;From here, take a ...;Admission Fee 20 CHF
Then inside each cell, take the text (e.g. 08.00am;Start your journey...;Train ticket cost 30CHF) and split it by ; to get another list of texts:
08.00am Start your journey... Train ticket cost 30CHF
Then just refer to the relevant item from that list (i.e. first item, item# 2, and last item) in your text boxes.
e.g.
In the first text box set the dynamic content to Current cell's Text: split by ; first item
In the second text box set the dynamic content to Current cell's Text: split by ; item# 2
In the third text box set the dynamic content to Current cell's Text: split by ; last item
Thank you!!! This gave me the final hint and in the end, I was overcomplicating by a lot. It was resolved by split first by “backspace” and then by “;”. Here’s the final result