cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
RobWickham
Level: Powered On

Notify a Teams Channel after a specific SharePoint document was checked-in?

So far I'm unable to find enough examples or working templates to achieve this. I'm brand new to Flow and to Teams, so I'd need some specifics too. I have spent a day reviewing and attempting this without success.

 

Regards,

Rob

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Community Support Team
Community Support Team

Re: Notify a Teams Channel after a specific SharePoint document was checked-in?

Hi @RobWickham ,

 

The difficulty in configuring a similar Flow is that no trigger can directly monitor whether a file is checked-in.

If you need such feature to be supported by MS Flow, consider voting for a similar idea:

https://powerusers.microsoft.com/t5/Flow-Ideas/Expose-SharePoint-Library-quot-Checked-Out-To-quot-co...

 

In addition, you could consider using the following methods to achieve your needs.

  • Use When a file is created or modified (properties only) as the trigger, Library is the Library where the specified file is located.
  • Configure Send an HTTP request to SharePoint action to get the CheckoutUserId.

CheckoutUserId:

body('Send_an_HTTP_request_to_SharePoint')['d']['CheckoutUserId']

Uri:

_api/web/lists/GetByTitle('LibraryName')/items(@{triggerBody()?['ID']})
  • To set Condition, the following conditions must be met:
  1. CheckoutUserId need to be null, indicates that this file has been checked in.
  2. The current file is the specified file
  3. The current file is not a newly created file
  • If the above conditions are met,  Post a message action is executed.

Image reference:59.PNG

 

60.PNG

 

Hope it helps.

 

Best Regards,

Community Support Team _ Barry
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

5 REPLIES 5
Highlighted
Community Support Team
Community Support Team

Re: Notify a Teams Channel after a specific SharePoint document was checked-in?

Hi @RobWickham ,

 

The difficulty in configuring a similar Flow is that no trigger can directly monitor whether a file is checked-in.

If you need such feature to be supported by MS Flow, consider voting for a similar idea:

https://powerusers.microsoft.com/t5/Flow-Ideas/Expose-SharePoint-Library-quot-Checked-Out-To-quot-co...

 

In addition, you could consider using the following methods to achieve your needs.

  • Use When a file is created or modified (properties only) as the trigger, Library is the Library where the specified file is located.
  • Configure Send an HTTP request to SharePoint action to get the CheckoutUserId.

CheckoutUserId:

body('Send_an_HTTP_request_to_SharePoint')['d']['CheckoutUserId']

Uri:

_api/web/lists/GetByTitle('LibraryName')/items(@{triggerBody()?['ID']})
  • To set Condition, the following conditions must be met:
  1. CheckoutUserId need to be null, indicates that this file has been checked in.
  2. The current file is the specified file
  3. The current file is not a newly created file
  • If the above conditions are met,  Post a message action is executed.

Image reference:59.PNG

 

60.PNG

 

Hope it helps.

 

Best Regards,

Community Support Team _ Barry
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

RobWickham
Level: Powered On

Re: Notify a Teams Channel after a specific SharePoint document was checked-in?

Barry,

Thank you for the reply. I will need some time to work through the details of this, unless you have additional screen shots or concepts you can share with me (I'm brand new to Flow, so the various config fields still feel aimed toward the expert.)

 

I have a clarifying question though about your suggestion. I see that the CheckoutUserId is null even after I simply modify the file using normal editing. What is the mechanism for determining that there was a state-change in that field? (CheckoutUserId going from non-null, to null)

 

Finally, I'd want to obtain the checkin comment and send that to Teams.

 

I have voted based on your initial suggestion as well.

Community Support Team
Community Support Team

Re: Notify a Teams Channel after a specific SharePoint document was checked-in?

Hi @RobWickham ,

 

Thank you for your reply.

You could try to configure Flow by step by step, which is not difficult. If there are any problems, just ask.

After your reminder, it seems that if this file has never been checked in and checked out, it seems that it also can pass the conditions I set.

There is a seemingly better way to do this, please check this thread and see if it helps:

https://powerusers.microsoft.com/t5/Building-Flows/Invoke-a-trigger-on-check-in-of-document/td-p/960...

 

Best Regards,

Community Support Team _ Barry
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
RobWickham
Level: Powered On

Re: Notify a Teams Channel after a specific SharePoint document was checked-in?

I wanted to make a clarification now that I've had more time to test. It seems the check for the CheckOutUserID is functionally only about making sure that at the time of the trigger, the document is not checked-out to anyone. It's NOT providing a way of checking that a "check-in event" has taken place.

 

I was hoping to use the event of checking-in a file to be a trigger to begin an approval workflow, since file modification could happen many times prior to the final check-in. I'm looking forward to the team adding some robustness to the check-in/check-out use cases.

RobWickham
Level: Powered On

Re: Notify a Teams Channel after a specific SharePoint document was checked-in?

I'm still interested if the technique for getting CheckOutUserId can be used to obtain any Check-in Comment data? I've seen this post that really helped me get the approval status, and it seems quite flexible:

 

https://powerusers.microsoft.com/t5/Building-Flows/Approval-Column-Not-Available-in-the-Dynamic-Cont...

 

Can it be used for data about checkin / checkout / comment?

Helpful resources

Announcements
firstImage

Microsoft Business Applications Virtual Launch Event

Watch the event on demand for an in-depth look at the new innovations across Dynamics 365 and the Microsoft Power Platform.

thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

firstImage

Incoming: New and improved badges!

We've given our badges an overhaul and also added some brand new ones!

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

sixthImage

Power Platform World Tour

Find out where you can attend!

seventhimage

Webinars & Video Gallery

Watch & learn from the Power Automate Community Video Gallery!

Top Kudoed Authors
Users Online
Currently online: 254 members 5,391 guests
Please welcome our newest community members: