cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
bansay
Level: Powered On

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
Dual Super User
Dual Super User

Re: Sort BrowseGallery items

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
Dual Super User
Dual Super User

Re: Sort BrowseGallery items

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
thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Power Platform World Tour

Find out where you can attend!

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

Top Kudoed Authors
Users Online
Currently online: 172 members 5,000 guests
Please welcome our newest community members: