-A document is uploaded to a "Working documents" library with some metadata columns such as "document department", "Dcoument status", etc.
-This is the departments list that the above "Document department" column is looking up
-So what the flow does is the following :
-When document is uploaded in working library, and the "document department" is populated with a value, this flow kicks in
- Note There is a "flowrun" column in the above "working documents" library, which the flow uses as a flag. This flowrun value is defaulted to "no" for newly uploaded document, and later changed to "yes" when this flow starts. This is to just let the flow know that it has to look at the latest uploaded document (the flow run for all previous documents will be yes whenever this flow completes). This is to help assign unique doc number to the currently uploaded document.
-This flow then looks up department list, appends the department short name, with a sequential number. (Eg, if department is Project delivery, then the numbers go like PD-001, PD-002 etc)
-In above example, document number is PD-178. If I upload the next document for "project delivery", number will be PD-179
-----------------
--------------------
Trigger condition
The below actions come in the "Yes" logical branch. here are some variables initialized
Then a apply to each loop to update doc count variable
Then another apply to each loop to update document list with the above "Doc count" Variable & set the document number
This is the next step (inside this "update document and list properties" loop, that actually sets the doc number
Then condition to check if "document number" column in library is null, only then populate it with the above set document number
Then if yes the document number (that was set above) is assigned to the uploaded document

Report
All responses (
Answers (