SOLVED

Move files based on user department

%3CLINGO-SUB%20id%3D%22lingo-sub-833024%22%20slang%3D%22en-US%22%3EMove%20files%20based%20on%20user%20department%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-833024%22%20slang%3D%22en-US%22%3E%3CP%3EHi%20All%2C%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20really%20need%20some%20help.%20I%20am%20trying%20to%20design%20a%20solution%20where%20our%20team%20create%20a%20document%20from%20a%20template%20in%20a%20read%20only%20library%2C%20the%20flow%20basically%20creates%20a%20new%20document%20and%20copies%20the%20%22File%20Content%22%20to%20the%20new%20document%20and%20places%20it%20in%20a%20drop%20off%20library.%20This%20is%20all%20initiated%20by%20clicking%20a%20button%20which%20is%20in%20a%20column%20next%20to%20each%20template%20(I%20have%20all%20of%20this%20part%20sorted).%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EFrom%20there%20the%20flow%20updates%20the%20file%20properties%20to%20include%20the%20users%20surname%20in%20the%20title%20of%20the%20new%20document.%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3ENow%20is%20the%20part%20that%20I%20am%20stuck%20on%2C%20I%20want%20the%20flow%20to%20then%20move%20the%20new%20document%20to%20a%20department%20library%20based%20on%20the%20users%20%22Department%22%20from%20their%20Office%20365%20profile.%20I%20have%20tried%20using%20the%20content%20organiser%20but%20it%20won't%20initiate%20organising%20on%20the%20created%20files%20and%20I%20know%20there%20used%20to%20be%20a%20SPD%20workflow%20action%20%22Submit%20to%20repository%22%20but%20this%20seems%20to%20be%20missing%20now.%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EDoes%20anyone%20have%20any%20idea%20on%20how%20I%20can%20achieve%20this%3F%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-833024%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EMicrosoft%20Flow%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EPowerApps%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3ESharePoint%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-833041%22%20slang%3D%22en-US%22%3ERe%3A%20Move%20files%20based%20on%20user%20department%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-833041%22%20slang%3D%22en-US%22%3E%3CP%3EHi%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F365905%22%20target%3D%22_blank%22%3E%40JustinR%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EBased%20on%20your%20scenario%20(assuming%20I%20understand%20it%20right)%2C%20I%20would%20save%20the%20new%20document%20to%20the%20users%20Department%20library%20FIRST%20and%20then%20add%20in%20the%20file%20attributes%2C%20etc%20once%20it's%20been%20created%20there.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EIt%20sounds%20to%20me%20that%20the%20drop-off%20library%20is%20purely%20a%20transactional%20place%20that%20you%20don't%20really%20need%20if%20you%20just%20generate%20the%20file%20in%20the%20desired%20location%20up%20front.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EBefore%20you%20create%20the%20new%20file%2C%20use%20%3CSTRONG%3EGet%20user%20profile%20(V2)%3C%2FSTRONG%3Eto%20get%20the%20users%20account%20attributes%20(use%20their%20email%20as%20UPN)%20and%20then%20the%26nbsp%3B%3CSTRONG%3EDepartment%3C%2FSTRONG%3Eattribute%20could%20be%20used%20as%20part%20of%20the%20location%20path.%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EHope%20that%20makes%20sense%3F%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EIf%20I've%20misunderstood%20anything%2C%20please%20let%20me%20know%20and%20I%20can%20revise%20the%20suggestion%20above.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3ECheers%20and%20best%20wishes%3C%2FP%3E%3CP%3EDamien%3C%2FP%3E%3C%2FLINGO-BODY%3E
Highlighted
New Contributor

Hi All,

 

I really need some help. I am trying to design a solution where our team create a document from a template in a read only library, the flow basically creates a new document and copies the "File Content" to the new document and places it in a drop off library. This is all initiated by clicking a button which is in a column next to each template (I have all of this part sorted).

 

From there the flow updates the file properties to include the users surname in the title of the new document. 

 

Now is the part that I am stuck on, I want the flow to then move the new document to a department library based on the users "Department" from their Office 365 profile. I have tried using the content organiser but it won't initiate organising on the created files and I know there used to be a SPD workflow action "Submit to repository" but this seems to be missing now. 

 

Does anyone have any idea on how I can achieve this?

1 Reply
Highlighted
Best Response confirmed by JustinR (New Contributor)
Solution

Hi @JustinR 

 

Based on your scenario (assuming I understand it right), I would save the new document to the users Department library FIRST and then add in the file attributes, etc once it's been created there.

 

It sounds to me that the drop-off library is purely a transactional place that you don't really need if you just generate the file in the desired location up front.

 

Before you create the new file, use Get user profile (V2) to get the users account attributes (use their email as UPN) and then the Department attribute could be used as part of the location path. 

 

Hope that makes sense?

 

If I've misunderstood anything, please let me know and I can revise the suggestion above.

 

Cheers and best wishes

Damien