cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
bansay
Frequent Visitor

Sort BrowseGallery items

 

Hello;

 

How is possible the update this code for improved the sort ?

 

I would like the sort to be done on "itemchoice", followed by the alphabetical order on "Requester.displayname".

=> First on my itemchoice

=> Second on my requester.displayname

 

For update the button to change the sort order (Ascending to Descending/Descending to Ascending), and have a good sort ! 

 

If(
    UserEmail in UserAdmin.Value;
    SortByColumns(
        AddColumns(
            Filter(
                'Home Working Test';
                StartsWith(
                    Requester.DisplayName;
                    TextSearchBox1.Text
                )
            );
            "itemchoice";
            If(
                Status_Request.Value = "Requested";
                "A"
            )
        );
        "itemchoice";
        "Ascending";
        "Title";
        If(
            SortDescending1;
            Descending;
            Ascending
        )
    );
    SortByColumns(
        AddColumns(
            Filter(
                'Home Working Test';
                Requester.Email = UserEmail;
                StartsWith(
                    Requester.DisplayName;
                    TextSearchBox1.Text
                )
            );
            "itemchoice";
            If(
                Status_Request.Value = "Requested";
                "A"
            )
        );
        "itemchoice";
        "Ascending";
        "Title";
        If(
            SortDescending1;
            Descending;
            Ascending
        )
    )
)

Thank you for your help ! 🙂 

 

1 ACCEPTED SOLUTION

Accepted Solutions
yashag2255
Dual Super User II
Dual Super User II

Hi @bansay 

 

In that case, you can update the formula as:
SortByColumns(
        AddColumns(
            Filter(
                'Home Working Test';
                If(UserEmail in UserAdmin.Value;Requester.Email = UserEmail;true);
                StartsWith(
                    Requester.DisplayName;
                    TextSearchBox1.Text
                )
            );
            "itemchoice";
            If(
                Status_Request.Value = "Requested";
                "A"
            );
            "RequesterDisplayName";
            requester.displayname
        );
        "itemchoice";
        "Ascending";
        "RequesterDisplayName";
        If(
            SortDescending1;
            Descending;
            Ascending
        )
    )
 
If this differs, please share more details about the logical flow.
 
Hope this Helps!
 
If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!

View solution in original post

1 REPLY 1
yashag2255
Dual Super User II
Dual Super User II

Hi @bansay 

 

In that case, you can update the formula as:
SortByColumns(
        AddColumns(
            Filter(
                'Home Working Test';
                If(UserEmail in UserAdmin.Value;Requester.Email = UserEmail;true);
                StartsWith(
                    Requester.DisplayName;
                    TextSearchBox1.Text
                )
            );
            "itemchoice";
            If(
                Status_Request.Value = "Requested";
                "A"
            );
            "RequesterDisplayName";
            requester.displayname
        );
        "itemchoice";
        "Ascending";
        "RequesterDisplayName";
        If(
            SortDescending1;
            Descending;
            Ascending
        )
    )
 
If this differs, please share more details about the logical flow.
 
Hope this Helps!
 
If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!

View solution in original post

Helpful resources

Announcements
PA_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

secondImage

Power Apps Community Call

Please join us on Wednesday, October 20th, at 8a PDT. Come and learn from our amazing speakers!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

Welcome Super Users.jpg

Super User Season 2

Congratulations, the new Super User Season 2 for 2021 has started!

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

Top Solution Authors
Users online (1,256)