cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
BiTry
Resolver I
Resolver I

Date order..... if the field is empty, it is not displayed after sorting

Hi,

Date order, if the field is empty, it is not displayed after sorting. I would like the empty fields to be at the beginning of the column in Data Table.

 

This 'onselect on icon 'Set(sort_var,"In_Date");UpdateContext({SortDescending1: !SortDescending1})

BiTry_0-1669898849020.png

This 'item in Data Table 'SortByColumns(Filter('OF',nev_keres_input_text.Text in Név), sort_var, If( SortDescending1, Descending, Ascending ) )

 

Thank you in advance for your help...

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
v-liwei-msft
Community Support
Community Support

Hi @BiTry 

 

Do you want to put the record with empty date column in the first row of the table?
I think the only way is to store the sorted items (Null record at the top) to the new collection, then display it in the table.

You can try to put the following codes to OnSelect of the Sort button, when click it, it will create a new collection that sorts as your expectation.

 

Set(
    sort_var,
    "Date"
);
UpdateContext({SortDescending1: !SortDescending1});
ClearCollect(
    myGalleryCollection,
    Filter(
        '1117',
        Date = Blank()
    )
);
Collect(
    myGalleryCollection,
    SortByColumns(
        Filter(
            '1117',
            Date <> Blank()
        ),
        sort_var,
        If(
            SortDescending1,
            Descending,
            Ascending
        )
    )

 

I have made a test for your reference:

vliweimsft_0-1669948622790.png

vliweimsft_1-1669948633098.png

 

 

Best Regards,

Levi

 

 

View solution in original post

2 REPLIES 2
v-liwei-msft
Community Support
Community Support

Hi @BiTry 

 

Do you want to put the record with empty date column in the first row of the table?
I think the only way is to store the sorted items (Null record at the top) to the new collection, then display it in the table.

You can try to put the following codes to OnSelect of the Sort button, when click it, it will create a new collection that sorts as your expectation.

 

Set(
    sort_var,
    "Date"
);
UpdateContext({SortDescending1: !SortDescending1});
ClearCollect(
    myGalleryCollection,
    Filter(
        '1117',
        Date = Blank()
    )
);
Collect(
    myGalleryCollection,
    SortByColumns(
        Filter(
            '1117',
            Date <> Blank()
        ),
        sort_var,
        If(
            SortDescending1,
            Descending,
            Ascending
        )
    )

 

I have made a test for your reference:

vliweimsft_0-1669948622790.png

vliweimsft_1-1669948633098.png

 

 

Best Regards,

Levi

 

 

THX! Work:)

Helpful resources

Announcements
Power Apps News & Annoucements carousel

Power Apps News & Announcements

Keep up to date with current events and community announcements in the Power Apps community.

Community Call Conversations

Introducing the Community Calls Conversations

A great place where you can stay up to date with community calls and interact with the speakers.

Power Apps Community Blog Carousel

Power Apps Community Blog

Check out the latest Community Blog from the community!

Top Solution Authors
Top Kudoed Authors
Users online (1,616)