Hi
I'm trying to use the sort icon to sort by start date for an Onboarding form but not getting anywhere.
Currently the Items property of gallery looks like this: SortByColumns(Filter([@'New User Process'], StartsWith(Title, TextSearchBox1.Text)), "Title", If(SortDescending1, Descending, Ascending))
The OnSelect looks like this: UpdateContext({SortDescending1: !SortDescending1})
I'm new to Powerapps so any help would be greatly appreciated.
Cheers
Solved! Go to Solution.
Hi @schandra1 ,
You just need the below - put your actual date field name where shown below.
SortByColumns(
Filter(
[@'New User Process'],
StartsWith(
Title,
TextSearchBox1.Text
)
),
"YourDateFieldName", //put actual date field name in here
If(
SortDescending1,
Descending,
Ascending
)
)
Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.
Hi @schandra1 ,
You just need the below - put your actual date field name where shown below.
SortByColumns(
Filter(
[@'New User Process'],
StartsWith(
Title,
TextSearchBox1.Text
)
),
"YourDateFieldName", //put actual date field name in here
If(
SortDescending1,
Descending,
Ascending
)
)
Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.
Hi @schandra1 ,
I agree with @WarrenBelz 's formula.
Just to supplement his reply.
Please notice the syntax of SortByColumns function:
SortByColumns( Table, ColumnName1 [, SortOrder1, ColumnName2, SortOrder2, ... ] )
The columnname decides sort by which column and the order of column name decides the sort order.
However, in your formula, the column name is Title, not StartDate.
SortByColumns(Filter([@'New User Process'], StartsWith(Title, TextSearchBox1.Text)),
"Title",
If(SortDescending1, Descending, Ascending))
So the sort icon will not work for start date.
If you only want to sort based on startdate, you just need to replace Title with startdate field.
Try this:
SortByColumns(Filter([@'New User Process'], StartsWith(Title, TextSearchBox1.Text)), "StartDate", If(SortDescending1, Descending, Ascending))
If you not only want to sort based on title but also want to sort based on startdate, you just need to add startdate field.
Try this:
SortByColumns(Filter([@'New User Process'], StartsWith(Title, TextSearchBox1.Text)),
"Title",Ascending,
"StartDate", If(SortDescending1, Descending, Ascending)
)
Here's a doc about this function for your reference:
https://docs.microsoft.com/en-us/powerapps/maker/canvas-apps/functions/function-sort
Best regards,
Hi Guys
Changing the start date field worked like a charm.
Thank you both for your help.
Cheers
User | Count |
---|---|
252 | |
106 | |
96 | |
51 | |
39 |