Sorting a RG based on :count list of dates

OK, so what about the list of Concert Dates? Is that truly just a vector?

Let’s check:

:point_up_2: Here are the expressions we are checking… And here is how it looks in run mode:
Looks like I was wrong about collapsing duplicates on :count… Full transparency:

There are still duplicate values in our list…

… however, the point remains the same: :count on this expression does not yield a LIST OF COUNTS, but just a scalar value… 47.

And, more importantly, you see that what we thought might be an array of arrays (concert dates) is just an array (a vector/list of concert dates)… We have no way of figuring out how many concerts each User is going to (except… you can see them in the RG’s right? We’ll get to that…)

CONTINUING:

You might have noticed that I already put our SEARCH into a List Shifter. (List Shifter is, amongst other things, a way to store a list and then reference it easily.)

And you might have noticed something else: You say, “Keith, I can see the ‘number of future concerts’ in each line in those repeating groups? Why can’t we just snag them out of there?”

To that, I tell you this: Repeating Groups are just a form of the “for each” loop… For each item in the repeating group, we can compute certain values… but those values are not held in any variable that we can access.

So, there are certain plugins that let you snag those values out of the page… literally grabbing them out of the repeating group and bringing them back into Bubble. But this is dumb… BECAUSE WHAT IF I DON’T WANT TO SHOW THE REPEATING GROUP, eh?

Hold on… Petra is texting and is wondering why I called her “hypothetical” in a previous message…

AND CONTINUING…

How can we get a list of “Concert Date counts”?

Here’s how my List Shifter is set up: It holds a list of “Concert Goers”:

But now, in its PROCESS Output type, I’m going to select “number”:

And now, I’m going to program it to transform the list of “Concert Goers” into a list of “number of concerts” each Concert Goer is going to. We will use the PROCESS List action to do this. But…

One of the strange and wonderful things about List Shifter is that it does not know the values of the items that it holds. Further, if it holds Things, it does not know the values of the fields of those things. But now we need to tell it, “Hey, I care about the ‘Concert Dates’ field because I want to inspect that in the PROCESS List action.”

So we do this:

First, set up a workflow triggered by “when this List Shifter is Initialized/Updated”:

And then we get:

And now we can build its workflow. We will use PROCESS List (and we can put one of those in the workflow), but first we will add an action called “SET Process Field of Interest”. We do this so that List Shifter can access that field:

:point_up_2: as our field of interest, we select “Concert Dates”. (Remember that “Concert Dates” is a list of dates.)

And now we add PROCESS List… and I’m setting the list to process to be the List Shifter’s Original List:

What PROCESS List will do is, FOR EACH item in the original list, do some functions… Essentially duplicating what a Repeating Group does.

When we continue, we’ll program those steps. …