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:
taskID | deptType |
12 | CC |
23 | MS |
34 | OR |
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>"
)
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!