I am having a table called Player List
Player list table contain the fields Name, Email ID, Date ,phone number
I am having another table Match fixtures
In this table I have fields ,Team 1,team 2
What i am trying to achieve is I need the player list shuffled in Match fixtures table in the fields team 1 and team 2
Any idea to achieve this,when i like a action else save a player list form
To the best of my knowledge, thatโs not possible.
Just to clarify, are you wanting to randomly assign players from the the Player List table into the Team 1 and Team 2 columns of the Match Fixtures table?
Sorry, but itโs not clear at all what you are asking/saying in the last part of the statement above.
@WillowMobileSystems
John,
Provided I have understood his request correctly, he wants the dropdown list content to be in randomly shuffled order rather than asc., desc., or in the list order. AFAIK, thatโs not possible.
If the dropdown is a list of Ref values, one can shuffle the list with a Valid If expression like:
ORDERBY(list-of-ref, UNIQUEID())
Thanks @Steve, thatโs a very good point. As the query was about team players, I havenโt thought that it could be a ref. However, if thereโs a Players table and itโs referencing that table, you may have a right indeed.
I would agree with both of you except it would only work once. Since this seems to be a game, likely there will be a need to periodically re-shuffle???
I believe the only way to provide a regular shuffling is to add a random number generating column to the players table which will always regen those numbers when a new Player record is added:
I need to add a random column in player list ,it will add in player table,
I am having a doubt, the matches records will automatically create when I add a new record in the player list table
Correct me if i am wrong
Sorry but I couldnโt be able to understand your question. Can you please re-phrase?
If new player is added to player table with all column including random column
In above sample application i am seeing one record in match table ,
My question is
It is automatically created when a new player is added .
Iโm sorry but I cannot follow you totally. The app preview I had posted was just a PoC of what you are asking up-to a certain extent on how could it be done.
Iโm totally unaware of your app build, your tables, your table schemas, the relationship of your tables etc.etc. So may I humbly ask how can I answer your question?
Sorry but your question is a bit ambiguous.
I am having a table Player list
Columns
Its possible to add a player list shuffled in match table column Team1 and Team2 ,when I add a new player in the Player List table.
Yes of course. The [RND] column is there just to provide that. The numbers in that column are not static and when you add a new Player record to the Players table, those numbers will be regenerated automatically because of the ArrayFormula in cell B1. Notice the change in numbers in my demo sheet when I add a new player to the players table.
REMINDER
Provided you add this [RND] column to your sheet and regenerate your table structure, expand the column structure for this column in the App Editor and clear away the SheetFormula value.
To answer this questionโฆno. AppSheet never automatically adds rows to tables. You would have to implement some action or workflow or use an input Form to add rows.
If you are finding that a row is being added to the Match table when you have added a new Player, then there must be some action or workflow that is being activated to make that happen.
Ah understood. And I agree that it is not supported directly - nor would it ever be.
However, you can build something to achieve it. For example, you could add a Sort column into the Player List table. Randomly assign an index into that Sort column for each Player. Then sort the Team 1 and Team 2 lists based on the randomly โshuffledโ player list.
This might require some slight design changes to support but I think it can be done.
User | Count |
---|---|
16 | |
7 | |
6 | |
3 | |
3 |