Bubble doesn’t add a trailing comma to list. What I believe is that you may have an empty value in your state list.
Did you use step by step an inspect everything in your request (or before with inspect button)? You may find for example value 1 - 20 value 2 - 50 and value 3 - (empty)
I see where you’re coming from, but I even set up a text element that showed the list count, which was accurate (showed 2, but the API was passed the comma at the end despite no empty 3rd value)
Other possible thing to check, but I don’t really believe it, is if your id already contain the comma and this is added to your state list. However, this mean that the list would be 20,50,
You could try to use :join with , but I don’t see axtually how this could help. If you can set your app in public view mode, we can probably see what happen actually.
Hey @greyginter, as a temporary fix, I think you could try adding a filter to avoid empty values. It’s weird you’re getting that extra comma without an extra value in the list
If that’s not the issue, then you should try copy/pasting the URL on the API connector on a text editor to look for the extra comma there
Thanks for the help, but there was no empty list item being added so I had to find a workaround.
I created a new element state that saved a single line of text, updated with the existing state value with :append “,” and :append “thing’s ID” when not empty, and just the "thing’s ID’ when empty. That way I just had a single line of text looking like “28,170” that I then split using a function in my Xano backend after it was passed to the API.
Removing id values from the list was a bit trickier, but I figured out that if I replaced the id value I wanted to remove with a comma, the list would go from “28,170” to just “28,” and then I could
find&replace any double commas “,” with nothing to remove them. Also worked with long lists like 28,170,210. If I were to remove 170 it would become 28,210 then replacing one of those double commas left 28,210.
Edit: this post isn’t showing the double commas so that doesn’t look like it makes sense but it works.