Managing documents in SharePoint efficiently can streamline workflows and enhance team collaboration. One key feature is the ability to check out and check in documents for version control and conflict avoidance. This blog post will guide you in automating the check-in process using Power Automate’s “Send an HTTP request to SharePoint” action.
Step 1: Create a New Flow
- Log in to Power Automate.
- Click on “Create” from the left-hand navigation pane.
- Select “Instant cloud flow” and provide a name for your flow.
Step 2: Add Compose Action to hold both your site address details and the relative URL of the document you want to check in.
Step 3: Add the HTTP Request Action
- Click on “New Step” to add an action.
- Search for “HTTP” and select “Send an HTTP request to SharePoint”.
- Configure the action with the following details:
- Site Address: Select your SharePoint site.
Site Address: Select your SharePoint site.
Method: POST
Uri: _api/web/GetFileByServerRelativeUrl('<server-relative-url>')/CheckIn(comment='Check-in via Power Automate', checkintype=0)
Headers: Accept: application/json;odata=verbose
Content-Type: application/json;odata=verbose
This is what the Power Automate Flow should look like:
Step 4: Save and Test Your Flow
- Save your flow by clicking on the “Save” button.
- Test the flow by uploading or modifying a document in the specified SharePoint library.
- Check the flow’s run history to ensure it executed successfully and that the document is checked in.