A very weird but seemingly the only way to find the index of a Thing in a list of Things

My situation: I have a Thing called Tool, which can consist of Things called Steps. I need to be able to reorder Steps. One way to do this is to add a Step field named Index and use it, but I wanted to find a way without additional DB overhead. I also know there’s a plugin for that, but it requires placing an Element on the page, and I don’t want that.

Here it is, as a GIF:
Hope this helps someone!d23f4e8945c9b549871a9df43fdee335

So you basically:

  1. Turn the “Steps” field into a Text, consisting of y’s and n’s (or any other chars, of course) depending on whether each Step is the current Step
  2. Remove everything after the first y (the current Step) from the Text
  3. Count the characters in the remaining Text

Yes, yes. That’s VERY weird. That’s Bubble for you ¯\(ツ)

P.S. If you look closely, you’ll also find a weird way to implement conditionals (take a yes/no value, and format it as text).

9 Likes

This is genius!

wow how did you even think this up :rofl: A+ (took me while to wrap my head around it, but i get it)

(and yes, i have no idea how i came across this post from 2 years ago)