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

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

secondImage

Demo Extravaganza Winner Announcement

Please join us on Wednesday, July 21st at 8a PDT. We will be announcing the Winners of the Demo Extravaganza!

V3_PVA CAmpaign Carousel.png

Community Challenge - Giveaways!

Participate in the Power Virtual Agents Community Challenge

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
Top Kudoed Authors
Users online (2,308)