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

Announcements

News and Announcements icon
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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Leaderboard > Power Apps

#1
Haque Profile Picture

Haque 103

#2
WarrenBelz Profile Picture

WarrenBelz 82 Most Valuable Professional

#3
wolenberg_ Profile Picture

wolenberg_ 67 Super User 2026 Season 1

Last 30 days Overall leaderboard