Best Use of Workflows - Need Advice

So I have a tournament bracket and I am trying to figure out the best way to use a workflow in a larger tournament.

My Button is called COMPLETE

32 Games in that Round

Using a Repeating Group to display the 32 games

OPTION 1

  • Make 32 buttons and use a Conditional to show them based on the game number (3 Actions inside that step)

Option 2

  • Make 1 button and put those 3 Actions (32 times - Total of 96 actions inside 1 button) inside the workflow and use the ONLY WHEN option when a Repeating Group Game is a specific Number.

This would be the largest (at this point) workflow I need to create in a specific round.

Thanks for any thoughts.

Scott

I don’t understand what the button should do.
If the game is complete, you should not need to create condition on anything else to update the “current cell game” to complete.

So maybe you can explain exactly what the button should do?

  1. Mark game complete
  2. Move Winning Player to game 49 (Player 1)
  3. Move Losing player to game 37 (Player 1)

This happens 32 times in my First round. AS the tournament progresses each round it happens less.

Using a repeating group to display (and change data like score for each player) so I have the option to do 1 of 2 ways using a button as stated above.

Just trying to get an idea which is more efficient/effective from a workflow perspective.

Thanks for the question and chance to clarify

This also depend on how your DB is structured. But technically, Only one workflow, 3 actions on 1 button in RG. You don’t need any condition.

The next question is how you will find which game your need to assign winner (or looser). This depend on your DB and how you create the games. So it’s hard for me to answer this question. But everything start from this initial game creation path.

My first step is to create the total number of games needed. 127. Assign an Event ID to it and a game number.

The RG displays first round game numbers 1-32.

The tournament bracket tells me which game they move to based on Win or Loss.

I have EVENTS (list details of tournament)

I Have GAMES (list specifics of an individual game)

So knowing each game in first round sends both players to new games (already created), I can do it with a button inside the RG. This takes me back to my original dilemma.

Do I make 32 buttons and show it when in that specific Game #help
or
Do I have just 1 button and inside the work flow have all the actions (3 total for a single game) 1. Move Winner 2. Move Loser 3. Mark Current game as completed

To comment on the need for a Condition. It would be needed if I hid 32 buttons and showed one that matched the GAME #.

32 buttons or even one button with 96 actions sounds like something not quite right with the design, but that may be presumptuous of me without having the full picture of your requirements. If you absolutely must choose between the two options, I would say that the separate buttons might be a little less risky - only because I haven’t ever seen that many (96) actions in a single workflow before and I don’t know if Bubble has any limitations in this regard. Separate buttons, each with its own workflow of 3 actions, may also be easier to manage. You could just put them in a dedicated workflow folder so that they do not clutter up your workflow editor.

That being said, I would suggest exploring ways to have just one button without 96 actions. A few possibilities come to mind, e.g. a custom workflow that takes the current game as a parameter; an API workflow that takes the current game and/or both players (and perhaps the next game) as parameters; a reusable element; or the bdk plugin that allows if then else types of statements - or any combination of the above.

thanks for he reply.

The reason I went with a RG to display these games was because the previous way I built it had 32 groups with a RG inside it. I was having to change a lot of items for each group and the page gets SUPER long.

So I was looking for was to make my page smaller and not have so many elements. My other option is to dedicate 1 page to a specific tournament (32 Double, 64 Double, 8 Single etc.)

I agree that a Repeating Group is the way to go. So are you saying that you will have just one button in your RG but since you have 32 rows you will end up with 32? If that’s what you meant then that is of course fine and the proper way to do it. I thought you were meaning to place 32 individual buttons on your page, each with its own separate workflow, which is what I believed might be indicative of a design flaw somewhere. Perhaps if you could share some screenshots it may help us understand a bit better what the issue is.

Yes. I figure I can place 32 buttons and use Conditions to show when it equals a specific GAME #. Then in that workflow the 3 Actions would be placed.

The other way is have 1 button and put all those Actions inside the 1 workflow and use the ONLY WHEN option for each specific GAME.

What I don’t understand is that why you are talking about 32 button.
The current cell will already return the game #. You don’t need to have 32 button. Just one with the 3 workflow.

Example of all process: You have an initial workflow (API Workflow maybe), that will create first 32 game. Each of time will also create related game for next step (16, 8, 4, 2 and 1).

But once it’s done, you will display the 32 game. You can choose the winner, choose the loser, and assign them to the next game all using only one button.

You should reduce the number of element and workflow on the page. Your app will be faster.

That 1 button has to recognize which game they are moved to.

For example

GAME 1
Winner moves to GAME 49 (Player 1)
Loser moves to GAME 37

GAME 2
Winner moves to GAME 49 (Player 2)
Loser moves to GAME 37 (Player 2)

GAME 3
Winner moves to GAME 50 (Player 1)
Loser moves to GAME 38 (Player 1)

Etc.

So if I use one button inside the repeating group I have to have all those specific actions based on a GAME # RG Cell. Inside that workflow I have to use the ONLY WHEN option to make that action work. (Lots of actions inside that 1 workflow)

If I have time, I will try to show you how I see that. This all start from the initial games creation.

I understand your current issue, but I think the main thing is just to set the initial game creation with link to next game. This will reduce a lot the number of conditions and workflow you will have in the game page.

1 Like

Link to the next game?

If you place a button in the cell of a repeating group it will be duplicated into each other cell in the RG automatically. And the workflow that is triggered from that button will “know” the thing that is being displayed in the cell, so you only need one workflow the actions will dynamically act on whichever item is in the cell.

But each game sends the winners and losers into different games. So I need some way to move them to the right game. I am just trying to figure the best way to design it.

The main idea is that:
You have, for example, 8 opponents. This mean initially 8/2 = 4 games. You use a API Workflow that will create 4 Games (1,2,3,4). This is the first round. So you will need to add loser game and winner game. So you continue to create game for Round2 using this kind of logic: If current game is odd, Create two game (winner, looser), and link them to current “game” in two differents fields linked to “game DB” So this mean that the current game will have a link to the next games. Do this kind of logic until you run the last round.
So the first workflow will create Round 1. Another Workflow will create round 2 or more. I suggest to have two number field= Round and Game #. And use a numbering like 1-1 (mean round 1, game1) and for other round: 2-1W 2-1L (mean round 2, game one Winner / Looser).

I hope you can understand what I mean. The complex part is the game creation, not the RG :wink: Once you will have create this, you will just have a RG where you will select the winner of game 1-1 and using the button, this will assign winner to next game (2-1W) and looser to 2-1L

1 Like

hmm…Gonna read a few times to let it sink in. But my initial game creation was 127 games for a 64 person double elimination tournament. It was slow so I decided to break it up into smaller chunks during the tournament. The first 32 were important to get started.

Thanks for your guidance and hopefully a smoother/faster development and performance of my site.

One question. Where and how do I LINK the games to previous round games?