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 / Can you AddColums, the...
Power Apps
Answered

Can you AddColums, then SortByColumn you added?

(0) ShareShare
ReportReport
Posted on by 82

I have an app that has tasks and specialties in Many to Many relationship.

I am trying pulling a report of all the specialties, then list the tasks associated with each one.

The data in the SpecialtyTask looks like:

taskIDdeptType
12CC
23MS
34OR

I have collections that represent _templateList (TASKS) and _Specialties 

 

 

 

//PULL A DISTICT LIST OF THE SPECIALTIES WITHIN MY TABLE
Concat(SortByColumns(Distinct(TravelerApp_SpecialtyTasks,deptType),"Result",Ascending),"<hr><strong>"&LookUp(_Specialties,deptTypeShort=Result).deptName&" | "&Result&"</strong>"
&"<table>"&
//I FILTER THE TABLE BASED ON RESULT FROM ABOVE
//HOWEVER THE LIST ISNT IN ORDER, so I am trying to Add a column and sort by it... this isnt working
Concat(SortByColumns(AddColumns(Filter(TravelerApp_SpecialtyTasks,deptType=Result),"taskName",LookUp(_TemplateList, ID=taskID)),"taskName",Ascending),"<tr><td>"&LookUp(_TemplateList, ID=taskID)&"</td></tr>")&"

</table>"
)

 

 

 

 AddColumnsSort.jpg

Categories:
I have the same question (0)
  • Verified answer
    jKell Profile Picture
    82 on at

    I found error in my AddColumns function.  I create column name, but in the LookUp() I didnt assign a value.

    Concat(SortByColumns(AddColumns(Filter(TravelerApp_SpecialtyTasks,deptType=Result),"taskName",LookUp(_TemplateList, ID=taskID).Title),"taskName",Ascending)

     

    LookUp(_TemplateList, ID=taskID).Title   was missing, once I fixed it, it works!

    AddColumnsSort_ANSWER.jpg

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
WarrenBelz Profile Picture

WarrenBelz 545 Most Valuable Professional

#2
Haque Profile Picture

Haque 314

#3
Kalathiya Profile Picture

Kalathiya 234 Super User 2026 Season 1

Last 30 days Overall leaderboard