How can I filter options based on the section name?

Please answer me ASAP

Processing: 2022-05-11 (3).png…
Processing: 2022-05-11 (3).png…
Uploading: 2023-11-05 (1).png…

I have more than 500 players in the players docket, and when a new player is added, the type of division is determined. What I want is that the registration page has five classes to play. When the first division is selected, 10 kg, it appears to me in the first or second player box, and they all share the same player division.

The same goes for the other section, 8kg. When I add players, only the list of players who have 8kg is shown to me.


I hope you can tell me anything that will help me, even if it is simple

Well, now I have a registration form, and there is more than one section in it, as you can see, such as Men (10 kg) and Youth (8 kg)… until the end of the form, and in each player field I linked it to the players docket to show all the names of the players. My problem is that I want to create a filter where when I register the names of the players, let us say the Youth (8 kg) section. When I register the first, second and third player… I want to see from the drop-down list only the names that share the same section, which is Youth (8 kg).

I don’t really get your means…
But I will assume like this
In doctype Players you have field division

Player 1 - division “10kg”
Player 2 - division “8kg”
Player 3 - division “10kg”
Player 4- division “3kg”

Then you want to filter those player when user input the registration form, according to their division
So in your Custom Script, you can filter those like this

frappe.ui.form.on('Registration',  {
    onload: function(frm) {
        # change first_player_1_8kg according to your field name
        cur_frm.set_query("first_player_1_8kg", function () 
                        return {
                                filters: { 'division': '10kg' }

Hope it helps ~

not working :smiling_face_with_tear:

It workeeedddd, thankk yoouuu :star_struck: :heart_eyes: :clap: