Without knowing your particular setup, I can’t offer specific advice. Perhaps you could include a link to your Editor.
Generally speaking, I think the key is to have another Datatype that is linked to your “things” so you can sort by a calculated value that is stored in the database (like I did with the “Line Item” datatype). This datatype acts as the variable based on the user inputs.
Rather than referencing the extracted list, I think you need to reference this special Datatype (i.e. line item) that is specific to the order or user, depending on your setup, and make the calculation based on some action taken by the user.
User enters a color. Colors are displayed in the repeating group. As User increases or reduces votes, Expression calculates trend factor in real time (because there is a time component; trend will be stale if it is saved to the database at the time the user votes). The goal is to sort the repeating group by the trend factor. How do I implement this?
Note: I also had to change it from a text field to an input field so it can read/save to the database properly. Unfortunately, the input field will not display out to four digits properly. (this may be a bug). So I brought back the text field as a display only, and hid the input field.
Ah, thank you Robert. I like the set up. Issue is, on page load, “trend factor = This Color’s trend factor” is not updating the database with the output of the Expression. I added a Sort Button with the same instruction for good measure. I also displayed the trend factor in the database and the trend factor output of Expression to be sure.
This seems like a good option, but doesn’t support a to-many relationship.
If a Contact stores a list of Transactions, and you need to display the Contacts ordered by the number of Transactions, this is surprisingly hard to pull off in Bubble.
This is why I added a SORT action to List Shifter. You can do any type of mapped sort. (List Shifter can of course also help you do things like build lists of values to sort by.)
Hey Keith, can you explain this further about sorting by a calculated value? Or if you have a link to an example?
My particular example, I need to sort by Thing’s Date + days [number field of days] - Current date/time:formatted as days and sort by the resulting number.
@tylerboodman further to my previous response, you’ll be interested in my NEXT video doc/demo about Floppy as I’ll be showing the List Math action, which makes computations on a list of numbers a snap.
I had meant to point to the video I did about sorting by calculated values / sorting by the count (number of items in) of some Thing’s list-type field, but had forgotten to do so. Here it is: