cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
lemonade747
New Member

Workflow for Check-In Document, Read&Collect Field in Properties Panel and Send Email to Needed Person.

Hi everyone,

 

I’m new to SharePoint Workflow, so I got stuck at some parts during my process. I’ll describe my workflow below.

There is a main folder called “Internal Forms and Procedures”, and when employees want to submit a new document or update an existing document, they need to open the Properties panel to choose a correct field called “Department[A].

There are many departments, and they are put in a separate list called “Department List” including the names of department heads and their emails [B].

Then the employees will “Check-in” that document to submit it (I cannot find the check-in option in workflow), and the Workflow will read the Department name in [A] and get the correct email from [B] and send the approval request to that department head email to get the approval from the manager.

-----------------------------------------------------

My problem:

  1. I could not find the check-in option in Workflow, so I chose “When a file is created (properties only)”, but it seems to be not correct because workflow always trigger every time I update a new document instead of waiting for the “Check-in” from the user.
  2. Workflow sent the approval request email to all departments in the list [B] instead of just the department email got from the properties panel of that file.

 

If any experts here have any ideas what I need to do, it should be great for me. I appreciate you all so much!

 

Thank you!

 

1.jpg2.jpg3.jpg

Properties PanelProperties Panel

 

Department ListDepartment List

1 ACCEPTED SOLUTION

Accepted Solutions

@lemonade747 

In my example, my approvers are stored in a list called Approvers.

I have a choice column in my library called Department

I have a choice column in my library called Approval status with values of New, Approved and Rejected

I update the Approval status column with the results of the approval.

Any expressions that I use can be seen in the notes for the action

In my get items action I have a filter query - only the row of data where the departments match is returned.  Note the single quotes in the filter query

In my apply to each, I am looping through what was returned by Get items which should only be 1 row

image.pngimage.pngimage.pngimage.pngimage.png

image.png

If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

Scott

View solution in original post

10 REPLIES 10
ScottShearer
Super User
Super User

@lemonade747 

It is always best to provide screen shots of your Flow.  That will make it much easier for people who would like to assist.

You can use the camera icon when you provide a response to upload your screen shots.

image.png

If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

Scott
lemonade747
New Member

Thanks @ScottShearer , I added the Screenshots for my case. I know it looks not very well, so that's why I need your suggestion.

Thank you!

@lemonade747 

Using the When a file is created trigger won't work well for you.  Can you use a For a selected file trigger instead?  That way, a user can manually kick of the Flow when they are ready.

It looks like you have the approvers in a SharePoint list. Can you post a screen shot of the list?  I am assuming that you want a single approver from the list.  How do you know what approver to select?

What do you want to happen when document is approved?  Can you add a choice column to the library to reflect the approval status?

 

If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

Scott

Hi , 

Thanks for your quick reply. I'll answer each of your questions below.

 

Using the When a file is created trigger won't work well for you. Can you use a For a selected file trigger instead? That way, a user can manually kick of the Flow when they are ready.

--> I'll try as you suggested

 

It looks like you have the approvers in a SharePoint list. Can you post a screen shot of the list? I am assuming that you want a single approver from the list. How do you know what approver to select?

--> I added the screenshots as you requested. Yes, I want a single approver from the list, and it is selected based on the user choice when they put in the correct Department name in the Department List in Properties Panel (please see the screenshot)

 

What do you want to happen when document is approved? Can you add a choice column to the library to reflect the approval status?

--> When the document is approved, it will send an email or notification to the user who requested. This part is easy and I could do that. The hard part is how to send the request email to single approver in the list.

 

@ScottShearer

@lemonade747 

I will provide an example

If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

Scott

Thanks @ScottShearer , I'll wait for your example

@lemonade747 

In my example, my approvers are stored in a list called Approvers.

I have a choice column in my library called Department

I have a choice column in my library called Approval status with values of New, Approved and Rejected

I update the Approval status column with the results of the approval.

Any expressions that I use can be seen in the notes for the action

In my get items action I have a filter query - only the row of data where the departments match is returned.  Note the single quotes in the filter query

In my apply to each, I am looping through what was returned by Get items which should only be 1 row

image.pngimage.pngimage.pngimage.pngimage.png

image.png

If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

Scott

Hi @ScottShearer ,

 

Thank you so much for a very detail example. Can't believe you did it in a short time like this. You almost got into the point I'm aiming, it's like 95% there.

 

The only thing I'm still looking for is the Check-In Trigger option in the workflow. As I understand from your workflow, everytime you upload a new document and set the correct department, the workflow will start to work.

What if I want something like when you upload a document, then you choose correct department, and then we Right-Click on that file to choose Check-in (please see the screenshot attached). And after that check-in (works like a "Safety Switch"), the workflow will actually start. The reason is, I don't want to trigger the workflow everytime we change the department name (i.e., it will send the email for every single changes from the department name).

 

So @ScottShearer  is there anyway to do this, or we have nothing to do with it?

 

Thank you again for your wonderful answer! I marked it as a solution for me!

 

Check-In on FileCheck-In on File

ScottShearer
Super User
Super User

@lemonade747 

Relying on a document being checked in will be problematic.  

As an alternative, why not have them set the Approval status to a value.

In the screen shot below, the Flow stops unless that Status is In Process.  The Default for the column is New.  After action is taken on the approval, I update the column to Approved or Rejected.

image.pngimage.png

The rest of the Flow is the same as in my original example.  Note that I am using a When an item or file is modified trigger.  The Get file properties action is not needed and has been removed.

 

If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

Scott

Hi @ScottShearer ,

 

That's a nice alternative! I'll try that for sure.

 

The reason why I'm using the check-in and check-out process is to make sure the users not accidentally update a new version without their needed purposes. And the another reason is, everytime you check-out a document and check-in again for a submission, SharePoint will automatically update a version to the next number (i.e., ver 1 to ver 2...). I tested the workflow you helped me yesterday and it didn't increase the version number. Maybe the problem is on my side. For now, I'm trying your method and will fix the version number later on.

 

Thank you again for your super useful help @ScottShearer. You are a truly knowledgeable person.

7.jpg

 

8.jpg

Helpful resources

Announcements
 WHAT’S NEXT AT MICROSOFT IGNITE 2022

WHAT’S NEXT AT MICROSOFT IGNITE 2022

Explore the latest innovations, learn from product experts and partners, level up your skillset, and create connections from around the world.

Register for a Free Workshop.png

Register for a Free Workshop

Learn to digitize and optimize business processes and connect all your applications to share data in real time.

Users online (1,574)