SOLVED

Filtering a view using the "created by" department

Iron Contributor

Hi all, I have a weird one for you. In a list, I want to create a view by filtering when the department of the creator of an item is equal to a specific department. And I want to get the value of the department attribute directly from the "Created by" element. I thought I could use the "contains" value, but that can only be used on non-indexed fields. Is there a special syntax I can use to access this attribute of the creator in the filter by field?  Perhaps I am out of luck, but since Flow can access those attributes, I thought I might be able to use something similar on filter.

4 Replies
Unfortunately no there is no way to get this info in the view options. One approach you can try is built a Flow and fill out the value when new item is created. Then create a view that group by the department column. Hope this help.
best response confirmed by shawn_fielding (Iron Contributor)
Solution

@shawn_fielding, There is a no way you can directly select a department of user from Created by field in "Filters" section of view settings.

As you know, you can get these details of user in Microsoft flow/Power Automate easily, try below steps to achieve this:

  • Create a single line of text field ("Department") and make it hidden from list forms.
  • Create a flow on item creation event.
  • In Flow, get the department of user from Created by field and set its value to newly created Department field.
  • Create a view and add filter on the Department field.

Please click Mark as Best Response if my post helped you solve your issue. This will help others find the correct solution easily. It also closes the item. If the content was useful in other ways, please consider giving it Like.

@ganeshsanap 

 

The one draw back to this solution is that it only fires on item creation.

 

I'd add an additional step to this to cater for records or items that are already present in the list.  Use the steps below but add them to a workflow that kicks off at a scheduled time and iterates through each item in the list.  When it concludes you'll have a list that's fully completed and will continue to update the Department field.

Wow, I was literally (and I use that word literally) was thinking about that problem and the solution you mentioned. Just for documentation, I was thinking of adding it so that it checks weekly. I wonder if the change itself would was spark the current flow "when an item is added or edited." That would be handy.
1 best response

Accepted Solutions
best response confirmed by shawn_fielding (Iron Contributor)
Solution

@shawn_fielding, There is a no way you can directly select a department of user from Created by field in "Filters" section of view settings.

As you know, you can get these details of user in Microsoft flow/Power Automate easily, try below steps to achieve this:

  • Create a single line of text field ("Department") and make it hidden from list forms.
  • Create a flow on item creation event.
  • In Flow, get the department of user from Created by field and set its value to newly created Department field.
  • Create a view and add filter on the Department field.

Please click Mark as Best Response if my post helped you solve your issue. This will help others find the correct solution easily. It also closes the item. If the content was useful in other ways, please consider giving it Like.

View solution in original post