web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Sort a gallery using a...
Power Apps
Unanswered

Sort a gallery using as sorting criteria a column from another sharerepoint

(0) ShareShare
ReportReport
Posted on by

Hello everyone,

 

I'm trying to sort a gallery of a sharepoint list using as sorting criteria a column from another list. Both lists have an ID column that is the relation of the tables.

 

Please let me elaborate:

 

The gallery shows the items from TableA, and the goal is to sort it using TypeColumnB as criteria.

 

After reading some posts I wrote this:

 

 

Sort(
 AddColumns(TableA;"NewColumn";
 LookUp(TableB;IDColumnB=IDColumnA.Value;TypeColumnB.Value)
 )
 ;NewColumn;SortOrder.Descending
)

 

 

 

Name in example (For clarity)DescriptionOriginal name
TableASharepoint List'232 - Actividades - Calibraciones'
TableBSharepoint List'232 - Lista de equipos e instrumentos - Calibraciones'
IDColumnInAA LookUp type column inTableA'ID de equipo Actividades'
IDColumnInBA Text type column inTableBTituloEquipos
TypeColumnInBMultiple choice column from Table B'Tipo @Equiposeinstrumento'

 

The problem is that the created column from the code above (NewColumn) is empty.

 

drudas_4-1682689533563.png

 

And in the end sorting doesn't work.

Any help would be apreciated.

Categories:
I have the same question (0)
  • NandiniBhagya20 Profile Picture
    4,667 Super User 2024 Season 1 on at

    Hi @drudas ,
    Try using below formula - 

    Sort(
     AddColumns(TableA;"NewColumn";
     Concat(LookUp(TableB;IDColumnB=IDColumnA.Value; TypeColumnB) ; Value ; ",")
     )
     ;NewColumn;SortOrder.Descending
    )

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
Kalathiya Profile Picture

Kalathiya 421

#2
WarrenBelz Profile Picture

WarrenBelz 386 Most Valuable Professional

#3
MS.Ragavendar Profile Picture

MS.Ragavendar 339 Super User 2025 Season 2

Last 30 days Overall leaderboard