SOLVED

Sorting button in Power App

%3CLINGO-SUB%20id%3D%22lingo-sub-1612313%22%20slang%3D%22en-US%22%3ESorting%20button%20in%20Power%20App%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1612313%22%20slang%3D%22en-US%22%3E%3CP%3EI%20have%20built%20a%20simple%20Power%20App%20with%20SharePoint%20List%20as%20the%20data%20source.%20Within%20the%20BrowseGallery%20I%20want%20to%20be%20able%20to%20sort%20by%20Date.%20Currently%20sorting%20is%20tied%20to%20Title.%20Code%20is%3A%26nbsp%3B%20SortByColumns(Filter(%5B%40'PowerNinja%20TalkSchedule'%5D%2CStartsWith(Speaker%2CTextSearchBox1.Text))%2C%22%3CSTRONG%3ETitle%3C%2FSTRONG%3E%22%2CIf(SortDescending1%2CDescending%2CAscending)).%26nbsp%3B%3C%2FP%3E%3CP%3EIf%20I%20change%20%22%3CSTRONG%3ETitle%3C%2FSTRONG%3E%22%20to%20%22Date%22%20the%20BrowseGallery%20goes%20blank.%20Guidance%20is%20appreciated.%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1612779%22%20slang%3D%22en-US%22%3ERe%3A%20Sorting%20button%20in%20Power%20App%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1612779%22%20slang%3D%22en-US%22%3EWhat%20column%20are%20you%20using%3F%20You%20need%20to%20make%20sure%20it%20matches.%20So%20as%20created%20or%20modified%20or%20is%20it%20a%20custom%20column%20named%20Date%3F%20I%20think%20that%E2%80%99s%20a%20reserved%20name%20so%20not%20sure%20if%20your%20using%20that%20just%20as%20an%20example.%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1614719%22%20slang%3D%22en-US%22%3ERE%3A%20Sorting%20button%20in%20Power%20App%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1614719%22%20slang%3D%22en-US%22%3EThank%20you%20for%20the%20reply%20Chris.%20Yes%20to%20your%20question%20(which%20I%20should%20have%20included%20initially)%20Date%20is%20the%20name%20of%20the%20column%20I%20created%20and%20would%20like%20to%20be%20able%20to%20sort%20within%20the%20Power%20App%20-%20chronological%20order%20by%20date%20.%20Thank%20you.%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1614787%22%20slang%3D%22en-US%22%3ERE%3A%20Sorting%20button%20in%20Power%20App%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1614787%22%20slang%3D%22en-US%22%3EIt%20should%20work%20then.%20Are%20you%20getting%20any%20errors%3F%20Need%20to%20go%20into%20your%20list%20%26gt%3B%20List%20settings%20%26gt%3B%20date%20column%2C%20and%20see%20what%20the%20actual%20column%20name%20is%2C%20it's%20at%20the%20end%20of%20the%20url.%20Make%20sure%20it%20doesn't%20have%20any%20special%20naming%20cause%20you%20have%20to%20use%20the%20system%20name%20to%20sort%20not%20just%20the%20display%20name%2C%20so%20if%20you%20renamed%20it%20for%20example%2C%20the%20original%20name%20might%20be%20different.%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1617427%22%20slang%3D%22en-US%22%3ERE%3A%20Sorting%20button%20in%20Power%20App%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1617427%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F869%22%20target%3D%22_blank%22%3E%40Chris%20Webb%3C%2FA%3E%26nbsp%3Bthank%20you.%20I%20think%20this%20is%20the%20issue.%20The%20column%20is%20named%20%22Date%22%20but%20is%20named%20within%20the%20URL%20as%20%22Event%20Date%22%20-%20I%20changed%20this%20column%20naming%20and%20didn't%20realise%20the%20impact.%20Thanks%20again.%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E
New Contributor

I have built a simple Power App with SharePoint List as the data source. Within the BrowseGallery I want to be able to sort by Date. Currently sorting is tied to Title. Code is:  SortByColumns(Filter([@'PowerNinja TalkSchedule'],StartsWith(Speaker,TextSearchBox1.Text)),"Title",If(SortDescending1,Descending,Ascending)). 

If I change "Title" to "Date" the BrowseGallery goes blank. Guidance is appreciated. 

4 Replies
What column are you using? You need to make sure it matches. So as created or modified or is it a custom column named Date? I think that’s a reserved name so not sure if your using that just as an example.
Thank you for the reply Chris. Yes to your question (which I should have included initially) Date is the name of the column I created and would like to be able to sort within the Power App - chronological order by date . Thank you.
best response confirmed by JCamp (New Contributor)
Solution
It should work then. Are you getting any errors? Need to go into your list > List settings > date column, and see what the actual column name is, it's at the end of the url. Make sure it doesn't have any special naming cause you have to use the system name to sort not just the display name, so if you renamed it for example, the original name might be different.

@Chris Webb thank you. I think this is the issue. The column is named "Date" but is named within the URL as "Event Date" - I changed this column naming and didn't realise the impact. Thanks again.