Skip to main content

Notifications

Power Apps - Building 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

  • Verified answer
    jKell Profile Picture
    jKell 82 on at
    Re: Can you AddColums, then SortByColumn you added?

    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

Microsoft Kickstarter Events…

Register for Microsoft Kickstarter Events…

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Announcing Forum Attachment Improvements!

We're excited to announce that attachments for replies in forums and improved…

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 145,567

#2
RandyHayes Profile Picture

RandyHayes 76,287

#3
Pstork1 Profile Picture

Pstork1 64,907

Leaderboard