Hello, I've been using Power Apps for a while and I can't filter my gallery in descending order,
indeed I have already filtered the gallery by status with IF but each time I want to add this
: SortByColumns('DataSource'; "ID"; Descendant)
I have some errors can someone help me please
Solved! Go to Solution.
Hi @Shekinah ,
Something like this should do it
SortByColumns(
Filter(
'Demande frais - Remboursement';
'Créé par'.Email = VarUserEmail &&
Switch(
varTabSelected;
1;
Statut.Value = "" || Statut.Value = "Nouveau";
2;
Statut.Value = "En cours";
3;
Statut.Value = "Refusé";
4;
Statut.Value = "Validé" && 'Etape en cours'.Value = "prêt pour payement";
5;
Statut.Value = "Validé" && 'Etape en cours'.Value = "clôturée"
)
);
"ID";
Descending
)
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.
Visit my blog Practical Power Apps
From what you posted,
SortByColumns(
'DataSource';
"ID";
Descending
)
should be correct. If you want it added to the code in your image, please post this code in Text.
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.
Visit my blog Practical Power Apps
@Shekinah, the only issue is your semi-colons and Descending spelling. It should be:
SortByColumns(
'DataSource',
"ID",
Descending
)
I hope this helps!
Please Accept as Solution if it solves your question. Or just give it a Thumbs Up if it is helpful as can help others.
LinkedIn: https://www.linkedin.com/in/charlie-phipps-%F0%9F%91%A8%E2%80%8D%F0%9F%92%BB-91338715b/
YouTube: https://www.youtube.com/channel/UChmFBGU1YKIU91sNMQ7buGg
Twitter: https://twitter.com/phipps0218
Hello @WarrenBelz ,
exactly I would like to add it to this code. how to achieve it
Here is the code in question
If(
varTabSelected=1;
Filter(
'Demande frais - Remboursement';
Statut.Value = "" Or Statut.Value = "Nouveau" && 'Créé par'.Email = VarUserEmail
);
varTabSelected = 2;
Filter(
'Demande frais - Remboursement';
Statut.Value = "En cours" && 'Créé par'.Email = VarUserEmail
);
varTabSelected = 3;
Filter(
'Demande frais - Remboursement';
Statut.Value = "Refusé" && 'Créé par'.Email = VarUserEmail
);
varTabSelected = 4;
Filter(
'Demande frais - Remboursement';
Statut.Value = "Validé" && 'Etape en cours'.Value = "prêt pour payement" && 'Créé par'.Email = VarUserEmail
);
Filter(
'Demande frais - Remboursement';
Statut.Value = "Validé" && 'Etape en cours'.Value = "clôturée" && 'Créé par'.Email = VarUserEmail
)
)
Thank you!
Hi @Shekinah ,
Something like this should do it
SortByColumns(
Filter(
'Demande frais - Remboursement';
'Créé par'.Email = VarUserEmail &&
Switch(
varTabSelected;
1;
Statut.Value = "" || Statut.Value = "Nouveau";
2;
Statut.Value = "En cours";
3;
Statut.Value = "Refusé";
4;
Statut.Value = "Validé" && 'Etape en cours'.Value = "prêt pour payement";
5;
Statut.Value = "Validé" && 'Etape en cours'.Value = "clôturée"
)
);
"ID";
Descending
)
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.
Visit my blog Practical Power Apps
I have error messages like this
Number of invalid arguments: 1 were received, 2 or more were expected. The 'SortByColumns' function contains invalid arguments.
The name is not valid. "Status" is not recognized.
Thanks it worked
User | Count |
---|---|
125 | |
87 | |
87 | |
75 | |
69 |
User | Count |
---|---|
216 | |
181 | |
140 | |
97 | |
83 |