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 / 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

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

WarrenBelz 386 Most Valuable Professional

#2
Kalathiya Profile Picture

Kalathiya 321

#3
MS.Ragavendar Profile Picture

MS.Ragavendar 311 Super User 2025 Season 2

Last 30 days Overall leaderboard