Dear all, I have the following statement below:
SortByColumns(Search(Filter('Table1',Dropdown1.SelectedText.Value in Choice 1&& Dropdown1_1.SelectedText.Value in Choice 2), TextSearchBox1.Text,"Item"), "Item", If(SortDescending1, Descending, Ascending)),
I'd like to insert the group by 'Item' into the above formula but i don't know where i need to insert the statement.
Could you please support me?
Thanks a lot in advance.
Hello @Antonio ,
You might try something like this - I have not tested it, but it should work.
SortByColumns(
Search(
Filter(
GroupBy(
'Table1',
[YourGroupField]
),
Dropdown1.SelectedText.Value in Choice 1 &&
Dropdown1_1.SelectedText.Value in Choice 2
),
TextSearchBox1.Text,"Item"
),
"Item",
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.
Hello,
i've been able to do additional progresses and I've changed the formula as follows:
SortByColumns(Search(GroupBy('Table1',"Item","Description1","Description2","Description3"),TextSearchBox1.Text,"Item"), "Item", If(SortDescending1, Descending, Ascending)))
In fact it is working for items as below on the DB
Item Description1 Description2 Description3 Location
1 A B C 1
BUT it is not grouping. In fact, it is not working for repeated items (the reason why I want to groupByItem)
Item Description1 Description2 Description3 Location
1 A B C 1
1 A B C 2
1 A B C 3
Can you help me to check what is wrong?
Thanks a lot
Hi @Antonio ,
Apologies - I left out the Group name which is required (typing from memory on a phone is never good)
SortByColumns(
Search(
Filter(
GroupBy(
'Table1',
[YourGroupField],
"[YourGroupName]"
),
Dropdown1.SelectedText.Value in Choice 1 &&
Dropdown1_1.SelectedText.Value in Choice 2
),
TextSearchBox1.Text,"Item"
),
"Item",
If(
SortDescending1,
Descending,
Ascending
)
)
But as you are grouping by multiple columns, you will also need AddColumns.
Here is a post from last week I did on a related topic - please see if this helps you.
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.
Hello,
unfortunately, it is still not working.
In particular, when it comes to add fields in the gallery like YourGroupName.Table1FieldName i got an error-
How can i get it solved?
Thanks a lot
Regards
Hi @Antonio ,
I assume you have replaced everything [in square brackets] with the name of your field or control without the brackets.
My code was simply an example of the structure you need to use.
Hello,
yes i did it.
This is the formula:
SortByColumns(Search(GroupBy('Table1',"ITEM","GRPBYITEM"),TextSearchBox1.Text,"ITEM"), "ITEM", If(SortDescending1, Descending, Ascending))
Then, when i try to add the to the Gallery1 the fields i need to be displayed i got the following message:"this formula uses scope which is not presently supported for evaluation"
Image is attached.
Thanks a lot
@WarrenBelz Thanks for the tag .
@Antonio
Could you please provide a screenshot of your data source and as well as the outcome you are wanting, maybe a simple example built in Excel for the latter? Could you also tell me the Items property of your gallery.
Im not 100% sure of your expectations but is seems to me that you are trying to reference a table by using a record, which is causing the error. I'm thinking a gallery inside your current gallery may suit your needs but can't be sure until I see what is going on.
This training provides practical hands-on experience in creating Power Apps solutions in a full-day of instructor-led App creation workshop.
Come together to explore latest innovations in code and application development—and gain insights from experts from around the world.
User | Count |
---|---|
192 | |
67 | |
46 | |
41 | |
22 |
User | Count |
---|---|
252 | |
121 | |
84 | |
80 | |
71 |