SOLVED

Filtering a view using the "created by" department

%3CLINGO-SUB%20id%3D%22lingo-sub-1544390%22%20slang%3D%22en-US%22%3EFiltering%20a%20view%20using%20the%20%22created%20by%22%20department%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1544390%22%20slang%3D%22en-US%22%3E%3CP%3E%3CSPAN%3EHi%20all%2C%20I%20have%20a%20weird%20one%20for%20you.%20In%20a%20list%2C%20I%20want%20to%20create%20a%20view%20by%20filtering%20when%20the%20department%20of%20the%20creator%20of%20an%20item%20is%20equal%20to%20a%20specific%20department.%20And%20I%20want%20to%20get%20the%20value%20of%20the%20department%20attribute%20directly%20from%20the%20%22Created%20by%22%20element.%20I%20thought%20I%20could%20use%20the%20%22contains%22%20value%2C%20but%20that%20can%20only%20be%20used%20on%20non-indexed%20fields.%20Is%20there%20a%20special%20syntax%20I%20can%20use%20to%20access%20this%20attribute%20of%20the%20creator%20in%20the%20filter%20by%20field%3F%26nbsp%3B%20Perhaps%20I%20am%20out%20of%20luck%2C%20but%20since%20Flow%20can%20access%20those%20attributes%2C%20I%20thought%20I%20might%20be%20able%20to%20use%20something%20similar%20on%20filter.%3C%2FSPAN%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-1544390%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EMicrosoft%20Lists%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3ESharePoint%20Online%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1544942%22%20slang%3D%22en-US%22%3ERe%3A%20Filtering%20a%20view%20using%20the%20%22created%20by%22%20department%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1544942%22%20slang%3D%22en-US%22%3EUnfortunately%20no%20there%20is%20no%20way%20to%20get%20this%20info%20in%20the%20view%20options.%20One%20approach%20you%20can%20try%20is%20built%20a%20Flow%20and%20fill%20out%20the%20value%20when%20new%20item%20is%20created.%20Then%20create%20a%20view%20that%20group%20by%20the%20department%20column.%20Hope%20this%20help.%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1545231%22%20slang%3D%22en-US%22%3ERe%3A%20Filtering%20a%20view%20using%20the%20%22created%20by%22%20department%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1545231%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F406546%22%20target%3D%22_blank%22%3E%40shawn_fielding%3C%2FA%3E%2C%20There%20is%20a%20no%20way%20you%20can%20directly%20select%20a%20department%20of%20user%20from%20Created%20by%20field%20in%20%22Filters%22%20section%20of%20view%20settings.%3C%2FP%3E%3CP%3EAs%20you%20know%2C%20you%20can%20get%20these%20details%20of%20user%20in%20Microsoft%20flow%2FPower%20Automate%20easily%2C%20try%20below%20steps%20to%20achieve%20this%3A%3C%2FP%3E%3CUL%3E%3CLI%3ECreate%20a%20single%20line%20of%20text%20field%20(%22Department%22)%20and%20make%20it%20hidden%20from%20list%20forms.%3C%2FLI%3E%3CLI%3ECreate%20a%20flow%20on%20item%20creation%20event.%3C%2FLI%3E%3CLI%3EIn%20Flow%2C%20get%20the%20department%20of%20user%20from%20Created%20by%20field%20and%20set%20its%20value%20to%20newly%20created%20Department%20field.%3C%2FLI%3E%3CLI%3ECreate%20a%20view%20and%20add%20filter%20on%20the%20Department%20field.%3C%2FLI%3E%3C%2FUL%3E%3CHR%20%2F%3E%3CP%3EPlease%20click%20%3CSTRONG%3EMark%20as%20Best%20Response%3C%2FSTRONG%3E%20if%20my%20post%20helped%20you%20solve%20your%20issue.%20This%20will%20help%20others%20find%20the%20correct%20solution%20easily.%20It%20also%20closes%20the%20item.%20If%20the%20content%20was%20useful%20in%20other%20ways%2C%20please%20consider%20giving%20it%20%3CSTRONG%3E%3CSTRONG%3ELike%3C%2FSTRONG%3E%3C%2FSTRONG%3E.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1547415%22%20slang%3D%22en-US%22%3ERe%3A%20Filtering%20a%20view%20using%20the%20%22created%20by%22%20department%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1547415%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F373269%22%20target%3D%22_blank%22%3E%40ganeshsanap%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThe%20one%20draw%20back%20to%20this%20solution%20is%20that%20it%20only%20fires%20on%20item%20creation.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI'd%20add%20an%20additional%20step%20to%20this%20to%20cater%20for%20records%20or%20items%20that%20are%20already%20present%20in%20the%20list.%26nbsp%3B%20Use%20the%20steps%20below%20but%20add%20them%20to%20a%20workflow%20that%20kicks%20off%20at%20a%20scheduled%20time%20and%20iterates%20through%20each%20item%20in%20the%20list.%26nbsp%3B%20When%20it%20concludes%20you'll%20have%20a%20list%20that's%20fully%20completed%20and%20will%20continue%20to%20update%20the%20Department%20field.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1547517%22%20slang%3D%22en-US%22%3ERe%3A%20Filtering%20a%20view%20using%20the%20%22created%20by%22%20department%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1547517%22%20slang%3D%22en-US%22%3EWow%2C%20I%20was%20literally%20(and%20I%20use%20that%20word%20literally)%20was%20thinking%20about%20that%20problem%20and%20the%20solution%20you%20mentioned.%20Just%20for%20documentation%2C%20I%20was%20thinking%20of%20adding%20it%20so%20that%20it%20checks%20weekly.%20I%20wonder%20if%20the%20change%20itself%20would%20was%20spark%20the%20current%20flow%20%22when%20an%20item%20is%20added%20or%20edited.%22%20That%20would%20be%20handy.%3C%2FLINGO-BODY%3E
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 (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.