cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Anonymous
Not applicable

Powerapps sort by date columt from sharepoint list

I have a SharePoint list called Projects.

In this list I have a Date column called NextFollowup.

What I did in SharePoint was use the power of "group by" to make a view and make it easy to see what projects are upcoming.

 

How can I do this in Powerapps? I want to sort by date so that i get:

next week first then

14 days from today and so on.

6 REPLIES 6
mdevaney
Super User
Super User

@Anonymous 
Do you want to sort the values in a gallery?  Just use some code like this:

 

 

Sort(your_datasource_name, DateColumnName, Ascending)

 


Or if you only want today and future days to show:

Sort(Filter(your_datasource_name, DateColumnName >= Today()), DateColumnName, Ascending)

 

If it is not what you wanted show an example.

 

---
Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."

eka24
Super User
Super User

You can do that on a Gallery.

Insert a Gallery and on the items of the Gallery put;

Sort (Datasource,NextFollowup, Ascending)

------------

If you like this post, give a Thumbs up. Where it solved your request, Mark it as a Solution to enable other users find it.

Anonymous
Not applicable

Ok, so this is actually getting me somwhere...

 

The problem now is that in my SharePoint list it looks like this:

 

The "Næste Opfølgning" is the "NextFollowup" column.
SharePoint clearly marks all the "null" values and then lists all the other dates with how many results there are.
sharepoint view.JPG
When i do your formula on my galery the list is split up into single entries like so:

powerapps.JPG

 

Is there no way to group theese like SharePoint does?

@Anonymous 
You can do it with 2 galleries on separate screens.

Put this code in the Items property of the gallery on Screen 1.

Sort(Distinct(your_datasource_name, DateColumnName), Result, Ascending)

 

Then use this code on the OnSelect property of Gallery1

Navigate(Screen2, None, {locSelectedDate: ThisItem.Result});

 

Finally, use this code on the Items property of Gallery2 on Screen2.

Sort(your_datasource_name, Result=locSelectedDate, Ascending)

 

---
Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."

Anonymous
Not applicable

Ok so i have created a Screen2 and on it i have inserted the last piece of code to the Galery2.

 

Im getting an error:

error.JPG

 

The 2 other steps are giving no errors.

 

Only the Galery2 that is on Screen2 is giving the above error.

Anonymous
Not applicable

Any more suggestions to how i can first filter results by same date (as in my SharePoint list) and then show individual items?

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.

Microsoft 365 Conference – December 6-8, 2022

Microsoft 365 Conference – December 6-8, 2022

Join us in Las Vegas to experience community, incredible learning opportunities, and connections that will help grow skills, know-how, and more.

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 (4,665)