1 Thing Plugin - Index Finder - Get the index number for any item in your list

I need this plugin, that why it exists.

I figured if I needed it, so do others. So it’s free. Mostly because it’s literally 7 lines of code.

This plugin does only one thing. If you have a list of Things and you want to know where in that list of Things a specific Thing is (you know, like, is this Thing the 4th Thing in that list of Things or the 82nd Thing in that list of Things)

Yeah, now you can know.

The plugin comes with:

  • One Element: Find Index
  • One State: Find Index’s Index #
  • One Action: Find Index A Find Index :man_facepalming:
  • One Event: A Find Index is found

You know the drill, find a spot to put the element on your page. Probably with all the other plugin elements.

In your workflow, add the Find Index A Find Index (I’ll rename that monstrosity later) action.

  • Data Type is well, the type of Thing.
  • The Data Source is your list of Things.
  • The Data Item is the specific Thing you want to know where it is in the… you get it.

When that action is run, your index number will show up in the Find Index element’s Index #.

Or you can set a workflow to trigger with the A Find Index is found event.

That’s it! And yes, the index # returned is a true Bubble index.

33 Likes

Could you actually please describe this another way? I’m unsure about how to use it.

I type in “Find” and I don’t even get any results in a Workflow Action. Does it need to be on a specific workflow?

I really just need to find the index of an item in a list when I’m in an existing action. Is this what this does?

Hey @mikepost80, sure thing. You will have to place the Find Index element on the page and then the workflow action will be available in the workflows.

1 Like

Thanks for the great plugin, @eli !!!

The plugin is working fine, but I’m getting this error.

I can’t find the cause of the problem when I access the red line url in this image.
https://dhtiece9044ep.cloudfront.net/package/run_debug_js/a6536b2bcddfc874ac644af47f8c118be9746b652c082003b5458f5a5a9fef7e/xfalse/x7
Do you know the cause of the problem?

Hi @oyogemasen,

Yep, pretty sure I know what’s causing this. Do you mind messaging me a link to your app? I’ll take a look and confirm.

Thanks, @eli!

After some trial and error, the error has been resolved!
I’ll talk to you again if I need help.
Thanks :blush:

1 Like

So will this not work with Backend Flows if it has to be on the page you want to use it on?

Isn’t the index number of a cell in a repeating group entirely a front end construction? I mean, it’s rendered in the browser and not a set value in the database? The data itself is stored in the database but the way it’s being displayed in a repeating group (and corresponding index) happens locally. Right?

@jrmayhew, currently you are not be able to use this in a backend flow but I’m open to adding that action to the plugin if it’s something important. Have just never had the request before.

@BrianHenderson The index is simply a reference to the position of a specific thing (number, string, datatype, etc) in a list of those things. The list can be displayed in an RG but the RG is simply a display element, not the actual list/array.

Eli this would be a huge thing for a back end flow for us, we provide Covid relief to applicant in the form of grants and we get around 5k-6k application for help a month. The most common question I see is where am I in the queue? or how long before I get seen? Whilst some of these question are easy to solve using repeating groups but we have applicants who don’t have access to a smartphone and we need to send a text message to say you are in position X there are 5 people ahead of you.

Doing a search for and getting a list back is fine for every person, in say a TRIAGE stage, sorted by date applied. But then to get the position of current item index in that search is very difficult.

@it1, gotcha, that makes sense and it seems like a useful addition to the plugin.

I’ve just added a new action called Find Index (backend) where you can access the ‘Result of this Step’s Index #’.

Also added an ‘error’ result so you can build in error handling as needed.

As an FYI, this new action can be used on the front end as well without needing the page element but will not be process as quickly as using the page element’s action.

Let me know if you have any questions!

cc: @jrmayhew

1 Like

Great thanks I will give it a try!

1 Like

Incredible, simple and it works. Shortly we will be able to send out covid support emails to people waiting and inform them where they are in the queue. I appreciate there are many ways to do this and having the option to has helped my unique situation. Thank you.

1 Like

@eli just downloaded this plugin, I’m having an issue where is only seems to work when I use the slow more or step by step mode in the inspector. When I try to use it in normal it doesn’t work, not seen a bug like this before.

1 Like

@jloyol That’s really odd. Bubble has been having some issues the last hour or so. Maybe give it another go? The other option would be to use the Find Index (Backend) action that will return a value in the workflow without needing the page element.

Hey @eli thanks a lot for building and allowing us to use.
I’m having a probably very simple issue here: can’t use it, LOL!
I’m having trouble with the ‘Thing to Find’. Just can’t seem to put anything in there that’s accepted by Bubble.
I’m surely missing something. My goal is to show a guest it’s position on a guest list. I’d like to search for the current user’s index number on said list.
Can you offer me some links or reading, or some help?
Thanks in advance.

@stefano,

Make sure the ‘Thing to Find’ is the same data type as is selected in the Data Type dropdown and that it is a single item. So it should look like this:

Data Type: Guest
List of Things: List of Guests
Thing to Find: Single Guest

Hey @eli thanks a lot for that but I guess I’m still stuck.
Here’s a screenshot.

As far as I understand the thing to find should be correct, for I have User type field in the Guest table, so that each guest name is assigned just one User.

What I’m trying to accomplish here check the current user’s position on the list of guest (aka the Waitlist).

@stefano The issue is a search creates what Bubble sees as a list, even if there is only one item in it. Click on the ‘more’ text and select the ‘:first item’ option. That should resolve the dreaded red text :slight_smile:

1 Like

Hey @eli thanks a lot for keeping an eye here. I did found that out eventually, after lots of going back and forth.

Great plugin.