Get the selected category’s position in the list using the indexOf action. On the indexOf complete event, rotate it into the first position by doing shift: rotate (the correct value will be either negative or positive of the found index, I can’t recall at the moment).
I actually went another route than creating a back end workflow. I created a hidden “admin” page that has a “Do every X seconds” action on it. I then rebuilt my ListShifter-related workflows on that page that performs its action, writes the answers to the DB and keeps my DB update to date completely by opening that page one day a week for about 6 hours. My app is seldom used on the weekends and so it’s a great time to expose that page and let it churn for a bit.
Not sure if I understand correctly.
Step 1: get indexOf - to get the index of the current subcategory that is selected in Index state Podkategorija (subcategory)
Step 2: this part I don’t get. How to put the number that Step 1 finds into the Rotate action from bellow:
Or I’m doing something wrong here?
Thank you in advance.
GET INDEX publishes the found index into some exposed state of List Shifter (read the docs). Rotate by that amount.
It looks like the list shifter output does not update when data is changed. Could this be a bug?
@Thimo are you just filtering or something? List Shifter updates when the result of its List to Shift expression actually changes.
Yeah was always the case for me as well. This time I am using the Bubble Airtable plugin and inside the list shifter I am filtering an Airtable call using a dropdown. I will send you a PM with an editor link so you can take a look
EDIT: @Thimo, Looking at your example and thinking about it: Unlike a Bubble “Search for…” which is a “live query” (that is, if the results of the search change, such as some item is removed or added to the db), API data calls (of course), are not.
So, List Shifter will not magically update when you think it should.
So, to force List Shifter to reevaluate its “List to Shift”, fire the RESET action at it. (All that Action does is run List Shifter’s update routine/initialization routine.) Note that you might run into another issue which is that responses from API calls may be cached, so you may need to update your API call with a hashbusting field (like a parameter “Date” where you pass Current Date/Time, but that you don’t send to the external API itself). (I assume you’re familiar with this concept, but FYI in terms of how caching might affect - or be affecting - you.)
EDIT: Another way to make List Shifter more “dynamic” when you need to is to make its source List to Shift a custom state. Now List Shifter will update whenever the value stored in the custom state is changed (via the Set State action).