Simple to describe at the interface level, but not so easy to implement "under the hood". To begin with, it depends first on what you have for a data model.
I once set up a Filemaker Database for an "AWANA Grand Prix"--that organization's version of scouting's Pinewood Derby. Cars raced on a 4 lane track and a single winner advanced to the next bracket. And I used a mouse click on the winning entry to advance it like you describe here.
To make this happen, I set up a form view layout with multiple portals, using button setup.. to change the fields in the portal row into buttons. I used a combination of relationships and portal filtering to control which entries appeared in a given portal. Clicking the button performed a script that changed values in either a match field or in a field used in a portal filter expression to "advance" the winning entry.
Thank you for the reply.
Do you have an example of that button script?
Not on hand.
It can be as simple as:
Set Field [PortalTableOccurrence::Bracket2 ; 1 ]
Bracket2 might be a match field in the relationship used for the Bracket2 portal. It could also be referenced in a portal filter expression, but then you have to do some extra stuff to get the filtered portal to update after the script modifies the field value.
On the other hand, the set field step could modify a field in the Parent record to get this result as well.
So far, I have a portal with eight names listed from my main data base connected through relationshp.
I do need to create second portal that winners will moved in to by clicking a button?
Each bracket to which winners advace would be a different portal. In my use of this appoach, I had 4 portals on the layout with 4 entries each to represent the "flight 1" initial heats. My mouse clicks caused one of 4 single row portals to update to show the winner for each initial heat. Clicking one of these winners moved them to a 9th single row portal to show the overall winner for that "flight" of 16 initial entrants.
By using one row portals for the advancing entrants, I was able to draw lines on my layout tool to contsruct my tournament brackets.
I am having trouble understanding your sample scrip button.
Set Field [PortalTableOccurrence::Bracket2 ; 1 ]
Can you explain how I can substitute my tables into your scrip?
I can't find PortalTable Occurrence?
Can you help with a scrip button that when button is clicked, the name on portal roll 1 moves to the portal roll 8?
I am new at write scrips
Using Portals would seem the obvious answer for this puzzle. However, repeating fields wioth one single table (one record per tournament) could also easily be employed as such:
Create 1 Repeating Field with 16 repeats = "Bracket_1"
Create 1 Repeating Field with 8 repeats = "Bracket_2"
Create 1 Repeating Field with 4repeats = "Semi_Finals"
Create 1 Repeating Field with 2 repeats = "Final"
Create One field, non-repeating = "Winner"
You could have used 1 Sinlge Repeating firls for ALL of the above, but makes the Scripting a bit more difficult.
Place 4 copies of field on left hand side of your Layout, each showing 4 repetitions...1st one = 1-->4, 2nd one = 5-->8, etc...so all 16 reps are displayed aloing left.
Fill in the Names of the Participants in first 16 repetitions. This would represent ALL Entrants in competition.
Create a new script that Will by Attached as OnEnter to the "Bracket_1" fields on your layout..should read like this:
// BEGIN SCRIPT Name = Tournmanet Table . onEnter Trigger . Set Names into Bracket_2
Set Variable [ $_name ; Value = GetActiveFieldContents ]
If [ not Isempty ( $_name )
Set variable [ $_rep ; Value = Valuecount ( List ( TournamnetTable::Bracket_2 ) ) + 1 ]
Set Field [ Field = TournamnetTable::Bracket_2[$_rep], Value = $_name ]
// END SCRIPT
Set up a separate occurance of the bracket_1 field for adding/removing Entrant names, OR add a global variable to script that recognizes when you DON'T want the script to process (allow editing), then set THAT global variable before entring fields for editing purposes.
Now, create 2nd script to move names from "Bracket_2" to "Semi_Finals" - base it on same logic as first Script...just change the names of fileds in script steps Set Variable $_rep, and Set Field. And so on, and so on...
The last script 'Move Name into Winner' can use same script logic WITHOUT the $_rep variable involved at all.
Aplogies if I missed something obvious in your needs, or in my solution.
Here is modified Script that accounts for WHICH Bracket_2 names should fall into after clicking them - so they end up next to each other form same starting group:
Wow! ok I will try this
Thank you David
It's your solution, but I would not recommend using repeating fields for this.
I would like to use the portal solution since I am already working with the portal, can you help me with the button scrip?
I have not seen your 'portal' setup, so I just threw together a Demo file using Portals instead of Repeating Fields (though THAT would be alot easier, not sure why Phil doesn't reccomend here, that is, beyond ALL the normnal reasons!) - hope this helps...Screenshot for basic setup/scripts used is attached as well below.
Here's a link to download the Demo file: https://www.dropbox.com/s/7p6xqg18sjbxpfv/Tournament.fmp12
All too often, repeating fields lack flexibility in ways that related tables of data do not.