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 / Filter by agent on sha...
Power Apps
Unanswered

Filter by agent on sharepoint work order list

(0) ShareShare
ReportReport
Posted on by 7

Hey there,


So we created a very basic "service request / work order" list in sharepoint. You know, problem description, name of person, a few other fields. One field is a people picker that is the agent its assigned to.

 

I am trying to create a powerAPP application for the technicians phones. I can click powerapp on the sharepoint list and it gives me an auto created application which is pretty good actually. The one change i want to make, is to FILTER the list by the agent that is assigned to the ticket. So it would take their login and filter the list based on the field. Then they would only see the work orders they ahve been assigned. Something like "where 'Assigned To' = CurrentUser". But i dont know the syntax at all, and internet searches are not helpful. It would also be helpful if you could filter out closed work orders as well.

 

Here is the current code, and below that my guess for how it would go. This is code from the BrowseGallery1 item and currently shows all service requests.

 

 

 

SortByColumns(Filter([@'IT - Service Request'], StartsWith(Title, TextSearchBox1.Text) ), "Title", If(SortDescending1, Descending, Ascending))

 

 

And below is what i was trying (which obviously is wrong because i dont know what i am doing and am not a programmer):

 

 

 

SortByColumns(Filter([@'IT - Service Request'], StartsWith(Title, TextSearchBox1.Text) where 'Assigned To' = CurrentUser ), "Title", If(SortDescending1, Descending, Ascending))

 

 

 It would be nice if power apps just took my listview where i have this configured and i could just apply a listview to this list, but from my internet research that cant be done either.

 

any help appreciated.

Categories:
I have the same question (0)
  • WarrenBelz Profile Picture
    153,034 Most Valuable Professional on at

    Hi @powerpeoplepick ,

    You were close in the structure

    SortByColumns(
     Filter(
     [@'IT - Service Request'], 
     StartsWith(
     Title, 
     TextSearchBox1.Text
     ) && 
     'Assigned To' = CurrentUser
     ), 
     "Title", 
     If(
     SortDescending1, 
     Descending, 
     Ascending
     )
    )

    Also if you have not already assigned CurrentUser, do this at App OnStart

    Set(CurrentUser,User().FullName)

     

    Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

  • powerpeoplepick Profile Picture
    7 on at

    Wow thanks. However it did not work. "invalid argument type". It suggests i use "as" or "in" or "exactin". But none of those work either. I also tried creating and copying this name to a text variable and then doing a AS on that, but it doesnt like that either.

     

    powerpeoplepick_0-1607727314302.png

    powerpeoplepick_1-1607727453572.png

     

    Under the APP menu i put in your code under OnStart as well.

    I would have guessed the people picker type field was screwing it up, but with the variable it should work. I want to also put in a && for Status != closed as well. That doesnt work either. So its probably some syntax error... I hate programming too meticulous... Sharepoint designer i can use pretty well, but there are lots of examples online for that. Powerapp less so.

     

    powerpeoplepick_2-1607727717976.png

     

  • WarrenBelz Profile Picture
    153,034 Most Valuable Professional on at

    Thanks @powerpeoplepick 

    I am now assuming that AssignedTo is a Person field and you want to the records where Status is not closed so  try this

    SortByColumns(
     Filter(
     AddColumns(
     [@'IT - Service Request'],
     "Assigned",
     'Assigned To'.DisplayName
     ), 
     StartsWith(
     Title, 
     TextSearchBox1.Text
     ) && 
     Assigned = CurrentUser &&
     Status <> "Closed"
     ), 
     "Title", 
     If(
     SortDescending1, 
     Descending, 
     Ascending
     )
    )

     Note that you may get a Delegation Error on the <> (does not equal) - what are the other Status possible values?

    You might also find this video from Shane Young useful on field type issues.

     

    Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

  • WarrenBelz Profile Picture
    153,034 Most Valuable Professional on at

    Hi @powerpeoplepick ,

    Just checking if you got the result you were looking for on this thread. Happy to help further if not.

    Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

  • powerpeoplepick Profile Picture
    7 on at

    Actually on friday i was trying with the <> and it suggests that i should be using that, but yet it also says its an error to use it.. The help tips aren't very helpful. I also tried a straight up = sign, but that doesnt work either. The column is actually called 'issue status' but i changed to that and its the same error.

     

    However the rest worked. So i looked into sharepoint choice lists, and i was able to get it going. Final code is below. The key was to put .Value (had to be upper case as well). Thanks for all your help.

     

    SortByColumns(Filter(AddColumns([@'IT - Service Request'], "Assigned", 'Assigned To'.DisplayName), StartsWith(Title, TextSearchBox1.Text) && Assigned = CurrentUser && 'Issue Status'.Value <> "Closed"), "Title", If(SortDescending1, Descending, Ascending))

     

     

  • powerpeoplepick Profile Picture
    7 on at

    actually i spoke too soon.... that only returns ONE list item, not all of them.... sigh.

     

    EDIT: Even if i pull out the filtering by issue status, it still only pulls one result with just the assigned query. So something with that first piece is wrong because it only pulls ONE record (there are 5 it should pull currently that are assigned to me)

  • WarrenBelz Profile Picture
    153,034 Most Valuable Professional on at

    @powerpeoplepick ,

    What are the other possible values of Status? <> means does not equal and is not Delegable, which is why you probably got the "triangle" error.

     

    Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

  • WarrenBelz Profile Picture
    153,034 Most Valuable Professional on at

    Hi @powerpeoplepick ,

    Just checking if you got the result you were looking for on this thread. Happy to help further if not.

    Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

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 717 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 329 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard