Looking through a comma separated string "list"
Options
![Jay](https://us.v-cdn.net/6037124/user_avatars/2364889.jpg)
Jay
Member ✭
More adventures in the bubble to xano migration!
When you export a list of users in bubble, you get a text column/field with a comma-separated list of email addresses.
[image.png]
Can I, and if so how do I loop through these emails?
I can query all users where Followers isn't empty, then create a loop for each user and within it create a loop on User.Followers? would that work? Would xano know this is a list despite technically being a single string?
[image.png]
Or was there a way during import to turn that column into a proper list?
When you export a list of users in bubble, you get a text column/field with a comma-separated list of email addresses.
[image.png]
Can I, and if so how do I loop through these emails?
I can query all users where Followers isn't empty, then create a loop for each user and within it create a loop on User.Followers? would that work? Would xano know this is a list despite technically being a single string?
[image.png]
Or was there a way during import to turn that column into a proper list?
Comments
-
What you have there is just a single text string. Arrays will always be denoted with array brackets [] - you can see the schema structure when you click on your column name.
You can use the SPLIT filter to transform a text string into an array. The separator to use in this example would be the comma. -
I have tried this.
I want to also trim any spaces between the emails after the commas but i get an error:
{"message":"explode(): Argument #2 ($string) must be of type string, array given"}
[image.png]
If i put the Trim at the split level i get the same error but for trim:
{"message":"trim(): Argument #1 ($string) must be of type string, array given"} -
This is because you now have a list. You would have to do a for each loop to apply a trim filter to each item of the array.
Another route might be to first use a replace filter to replace spaces with nothing, then use the split filter
Categories
- All Categories
- 53 ? Announcements
- 47 ? Releases
- 37 ? Welcome
- 983 ? Help! I'm a Noob
- 125 ? No-Code Front-Ends
- 633 ? Working with APIs
- 439 ? Transforming data
- 126 ? Connect Xano to ...
- 50 ?? Find an Expert
- 348 ❓Other questions
- 35 ? Security
- 22 ✂️ Snippets
- 19 ? Showcase
- 7 ?️ Xano Chatter
- 62 ? Video Tutorials
- 171 ? Request a feature
- 229 ? Report a Bug
- 19 ? Templates & Extensions
- 7 ? Feedback