How to reverse the order of a list?

Im using an API to filter the list of objects i want to display :
image
I am not using a repeating group, im using a plug in that allows me to display objects like Tinder :


But i need to reverse the list…And i don’t know how to do

If the list is being fed into the plugin from some page element you can sort it there first and hope the order holds in the plugin. I have no idea how the plugin works and can’t speak to it but bubble has a simple ascending/descending toggle for lists.

how this toggle works ? because if you make reference to “Sort By action”, bubble.io obliged me to select an attribute but i cannot use an attribute for this situation.

I think my List Swapper plugin might be of use.

Sadly, i don’t use a repeating group here. If you are a plug in that changes the order of a list without changes on a repeating group, it would be very great.

It doesn’t require a repeating group.

EDIT: Let me know if you need any help setting it up. Also, I plan on adding some more dynamic abilities to do things like dynamically change the row/column type and sizes of the rows/cols spacing as well.

Ok so how can i do to use your plug in for this list : CARD LIST

So what the plugin does is makes it so you have two sections inside a group, and you can swap them around without adding additional conditionals like making things hidden manually, etc…

What its main purpose was to make it easier to swap elements like chat conversations from one side to another.

You add the list swapper either inside your repeating group (which you don’t have) or inside your group where you will be swapping the items.

How to reverse the order of a list?
This is easily done by applying a descending or ascending order on your list when you “Do a Search for”.

This plugin may not be for you
I misread your question. Seeing you’re just trying to “reverse” a list of things, that would either be descending or ascending. So my plugin may not actually be what you need to accomplish this as Bubble can do this off the bat. Apologies about that.

Thank you very much for your help and your plug in could be very usefull, thanks. But you said that bubble.io can do this off the bat…i don’t find how to do because the action “sort by” need to indicate an attribute, however, in my case i just need to inverse the order of the list without indicate any attribute do you know how to do it ?
I would be very grateful

I’m sorry, forgot you need to add a sort property.

Ideally, if you want to sort your items not by a created/edited/published date, you can add your own field inside your data type that would be your sort field. That would be a number.

image


there isn’t an action like “inverse the list” or something like that…

image

Just use the Do a Search for initial constraints rather than adding a filter at the end.

This will prevent additional data being leaked as your filters happen AFTER your datatype is queried.

Unless of course you’re using the filter for search filters or something else, then do your thing.

Also, you can add :sorted at the end as well.

thank you very much for you message, but as you can see :

image
You have to sort by a number. But in my case, the datas are display by an API, so i don’t have any Sort_number or something like that on my data base. THe only solution i have is to use a plug in or hard code to simply, REVERSE the list. And there is no way to reverse by the tool : SORT BY, because bubble require an attribut : “a sort_number” or a “creation date”…i don’t have that, i cannot use that,

What API are you using?

The api of PINECONE

Which call are you using? I need to see an example response. There may be a way to do this without anything, but if not, then you’ll need to apply some Javascript to your query data to reverse it.

Thank you, its an example of a call, but there is no way to reverse the list.

PINECONE_API_KEY="YOUR_API_KEY"
INDEX_HOST="INDEX_HOST"

curl -X POST "https://$INDEX_HOST/query" \
  -H "Api-Key: $PINECONE_API_KEY" \
  -H 'Content-Type: application/json' \
  -d '{
    "vector": [0.3, 0.3, 0.3, 0.3, 0.3, 0.3, 0.3, 0.3],
    "filter": {"genre": {"$eq": "documentary"}},
    "topK": 3,
    "includeValues": true
  }'

I am not a developer do you know how to do with javascript ?

I’ll shoot you a DM about a private solution.

thank you :slight_smile:

This topic was automatically closed after 70 days. New replies are no longer allowed.