← All guides

GUIDES · POWER AUTOMATE

Classify SharePoint, OneDrive and Google Drive files with your own model in Power Automate

StayCharted has a certified connector in Power Automate. Its Classify a record action sends a piece of text to one of your published models and returns the category, a confidence from 0 to 1, and whether the answer needs review. Because it's an ordinary Power Automate action, it fits into any flow that can read text from SharePoint, OneDrive, Google Drive, Outlook, Teams, Forms or Dataverse, and the answer can be written back to the same place.

By StayCharted ·

Before you start

  • A StayCharted plan with API access (Essentials or Business), a published model, and an API key from Workspaces → your workspace → API keys.
  • A Power Automate license that includes Premium connectors. The StayCharted connector is Premium. Your Microsoft administrator can confirm what your license covers.
  • Permission to create a cloud flow in your environment.

The action

Connector StayCharted AI Model Trainer
Action Classify a record
Inputs Model: a list of your published models. Text: the text to classify.
Outputs Answer: the category. Confidence (0 to 1). Needs review: true when the confidence is below the review cutoff you set for the model.
Connection Your StayCharted API key, entered once when you create the connection.

The first time you add the action, Power Automate asks for a connection name and your API key. After that, the Model list shows the models you've published, and a new version of a model is used as soon as you publish it, with no change to the flow.

Power Automate's Add an action panel, searched for StayCharted, showing the Classify a record action.
Search for StayCharted in Add an action. Classify a record is listed under StayCharted AI Model Trainer, with the Premium icon.
Classify a record settings with Model set to Field service request type and Text set to the SharePoint item's Title.
The action has two inputs: the model, picked from your published models, and the text to classify.

Example 1: SharePoint list items

A field service team logs requests in a SharePoint list. The flow suggests a request type for each new item and writes it back to the list.

  1. Create an automated cloud flow with SharePoint's When an item is created trigger. Choose the site and the list.
  2. Add Classify a record. Pick your model and set Text to the item's Title (or a description column).
  3. Add SharePoint's Update item, with Id from the trigger. Write Answer to a text column such as "StayCharted category", and Confidence to a number column.
  4. Optionally, add a Condition on Needs review: when it's true, start an approval or post to a Teams channel so a person checks the answer.
Power Automate flow with three steps: When an item is created, Classify a record, Update item.
The finished flow: a new list item, Classify a record, and Update item to write the answer back.

In our test, the item "The kitchen sink is leaking under the cabinet and the floor is wet" came back as Plumbing with a confidence of 0.71, written into the list within a minute of the item being saved.

SharePoint list with the StayCharted category column filled in as Plumbing by the flow.
SharePoint list with the StayCharted category column filled in as Plumbing by the flow.
Power Automate run details for Classify a record, showing label Plumbing, confidence 0.71 and needsReview false.
Power Automate run details for Classify a record, showing label Plumbing, confidence 0.71 and needsReview false.

Example 2: Google Drive files

Power Automate's Google Drive connector has no trigger for new files, so this flow runs on demand or on a schedule. It classifies every file in a folder by its name and saves the answer as a small text file in a results folder. In our test, three service requests saved as Google Docs came back as HVAC, Electrical and Appliance.

  1. Create an instant cloud flow (Manually trigger a flow), or a scheduled flow that runs every hour.
  2. Add Google Drive's List files in folder and choose the folder.
  3. Add Classify a record, with Text set to the file's Name. Power Automate puts it inside an Apply to each loop for you.
  4. Inside the loop, add Google Drive's Create file in a results folder. A file name built with the expression below puts the category in the name, so the results folder reads as a sorted list.
Successful Power Automate run with List files in folder, then a For each loop of 3 containing Classify a record and Create file.
A test run: the flow listed the folder, then classified each of the three files and saved a result file for each.
Google Drive results folder with one file per request, each named with the category StayCharted returned.
Google Drive results folder with one file per request, each named with the category StayCharted returned.

The lock request was classified as Appliance because this demo model had no locks or doors category. Add representative examples for the categories your team actually needs, and check the report before using the model.

Use your flow’s actual action names in this expression:

Show text example
concat(items('For_each')?['Name'], ' - ', body('Classify_a_record')?['label'], '.txt')

For scheduled runs, track processed files or filter the source list to avoid classifying the same files again on every run. Keep the results folder separate from the source folder.

The same flow with OneDrive

OneDrive for Business has a When a file is created trigger, so the OneDrive version runs on its own as soon as a file is added. Use that trigger in place of the manual trigger and List files in folder, set Text to the file name, and write the result with OneDrive's Create file, or move the file into a folder named after the category with Move or rename a file. Everything else is the same as the Google Drive flow.

The SharePoint and Google Drive examples above were run in our demo accounts. We have not run this OneDrive version yet.

What to send as Text

The model answers from the text you send it, so send the same kind of text it was trained on. If you trained on request descriptions, send the description column, not the title. A file name works when your names are descriptive, as in the examples above. For the contents of a document, add a step that reads the text first; the connector doesn't open files itself.

Common questions

Does StayCharted connect to my Microsoft 365 or Google account?

No. Power Automate sends StayCharted only the text you map into the action, and StayCharted answers. Your flow does the reading and writing in SharePoint, OneDrive or Google Drive, with the connections you created.

Where do unsure answers go?

Each answer includes Needs review. On Essentials and Business, answers below your review cutoff also appear in StayCharted's Review Queue, and the answers your reviewers confirm go into the next version's training.

How does it count against my plan?

Each record you classify is one prediction in StayCharted, shown under Plan & usage. Power Automate counts the run against your Power Platform request limits as usual.

Can I still use the HTTP action?

Yes. The REST API works the same way, and the HTTP action is still the way to send several columns at once or to use a model with a different input, such as the SharePoint access model. See SharePoint access with Power Automate.

SharePoint access with Power Automate →

Put it into practice

SharePoint access with Power Automate →

API reference →

Use your model in Zapier →

Use your model in Make →

Document categories for Microsoft Purview →

Microsoft, Power Automate, SharePoint and OneDrive are trademarks of the Microsoft group of companies. Google Drive is a trademark of Google LLC. StayCharted is not affiliated with Microsoft or Google.