GET STARTED · MICROSOFT WORKFLOWS
AI classification in Power Automate with StayCharted
Send prepared text to your trained model. Write its category and confidence back to SharePoint. Give uncertain results to a person.
SharePoint row → StayCharted model → category and confidence → Microsoft review workflow.
Before you start
You need a published text model in StayCharted AI Model Trainer, an API key, and a plan with API access (Essentials or Business). Train using reviewed examples that resemble the text your workflow will send. Check the held-out results before using its answers.
You also need permission to create a Power Automate cloud flow, access to your SharePoint list, and Microsoft licensing that covers the HTTP action. Ask your Microsoft administrator to confirm licensing and tenant data policies. See Power Automate licenses.
This guide describes an integration using the documented API and Microsoft actions. It has not yet been verified end to end in a Microsoft tenant. It is not an installed StayCharted connector or a downloadable flow.
For the business context and a sample file catalog, read Why AI Needs More Than Access to Your Files.
1. Prepare a SharePoint list
Start with a list of supplier-document summaries. Each row already contains readable text, prepared by your team or an existing system. Your model might categorize these as Insurance certificate, Purchase order or Supplier agreement.
Create these columns using the names below so the example expressions match:
| Column | Type | Purpose |
|---|---|---|
| Title | Existing text column | Name or reference for the record |
| InputText | Multiple lines of plain text | Text to categorize |
| SuggestedCategory | Single line of text | The model’s answer |
| ModelConfidence | Number | Confidence from 0 to 1 |
| ReviewStatus | Choice | Pending, Categorized, Needs review, Error |
| ApprovedCategory | Single line of text | The category confirmed by your reviewer |
Use a separate approved category so a later prediction cannot overwrite a human decision. Keep the source file’s link or identifier alongside the row if you need to trace it back.
2. Start a flow when a row is created
In Power Automate, create an automated cloud flow with SharePoint’s When an item is created trigger. Select the site and list.
Add a Condition that checks InputText is not empty. End the empty-input branch without calling the model. Initially, add test rows one at a time.
Using a creation trigger avoids starting the same flow again when it writes its answer. If you later switch to a modification trigger, add an explicit processing-status guard and a way to identify the input version being processed.
3. Call your published model
Create an API key in StayCharted under Settings → API keys, and copy your published model ID. Use a separate key for this integration. API setup and reference.
Add the general HTTP action and rename it Classify. Do not use SharePoint’s “Send an HTTP request to SharePoint” action for this external API.
| Field | Value |
|---|---|
| Method | POST |
| URI | https://amt.staycharted.com/api/v1/models/<MODEL_ID>/classify |
| Authorization header | Bearer <YOUR_API_KEY> |
| Content-Type header | application/json |
For the Body, use the Expression editor to build a JSON object:
setProperty(json('{}'), 'input', triggerBody()?['InputText'])
Replace <MODEL_ID> and supply the key through your organization’s approved secret-management method. Building an object preserves quotes and line breaks in the input instead of manually concatenating JSON.
Enable Secure inputs and Secure outputs on actions handling the key or sensitive content, and review access to the flow itself. These settings hide values in run history; they do not prevent authorized flow editors from accessing the integration. Microsoft guidance.
4. Read the category and confidence
On a successful request, /classify returns label, confidence, modelId and modelName. Confidence is a number from 0 to 1. The category depends on the model you trained.
Add Parse JSON, rename it ParseResult, and set Content to the Body output from Classify. Use this schema:
{
"type": "object",
"properties": {
"label": { "type": ["string", "null"] },
"confidence": { "type": ["number", "null"] },
"modelId": { "type": "string" },
"modelName": { "type": "string" }
},
"required": ["label", "confidence"]
}
Check that label and confidence are not null before comparing confidence with a cutoff. Missing answers go to review or an error branch, never straight through as successful classifications.
5. Write the result and route review
Add SharePoint’s Update item action. Use the ID from the trigger and preserve Title and any other required fields. Map:
| SharePoint column | Parsed value |
|---|---|
| SuggestedCategory | label |
| ModelConfidence | confidence |
Choose a review cutoff using your model’s evaluation and the cost of a mistake. Add a Condition: confidence greater than or equal to that cutoff sets ReviewStatus to Categorized; lower confidence sets it to Needs review. Do not treat a confidence score as a guarantee that an answer is correct.
Create a SharePoint view filtered to Needs review. A reviewer can check the original text and write ApprovedCategory. This is your Microsoft review workflow; writing these fields does not automatically put the record into StayCharted’s Review Queue or retrain your model.
Bring approved corrections back into your training examples when you are ready to evaluate and publish a new version.
6. Handle errors and test the flow
Configure an error-handling branch to run after the API action fails or times out. Set ReviewStatus to Error and keep the original text available for review.
| Response | What to do |
|---|---|
| 401 | Check or replace the API key. |
| 402 | Check API plan eligibility or the remaining monthly allowance. |
| 404 or 409 | Check the model ID and whether the model is published and available. |
| 429 | Wait for the Retry-After interval before retrying. Bound the number of retries. |
| 503 | Retry after a delay; surface persistent failures to the operator. |
Workspace rate limits are shared across keys and workflows. Start with low concurrency and pace calls within the limits in the API reference. A timed-out request may already have been processed: repeated calls can consume additional predictions. Keep the source row ID and processing status so write-back is traceable.
Test normal text, quotes and line breaks, an empty input, an invalid key, and your below-cutoff review branch. Compare a small set of results against calling the same model directly. Confirm that the flow writes back to the correct row and preserves human-approved labels. Test retry handling in a controlled setup rather than deliberately flooding the production API.
For a large historical backlog, use StayCharted’s file fill and import the reviewed results. Use the API flow for arriving records at a rate your plan supports.
Extend it to a document library
Once the list flow works, use a document-library workflow to supply the prepared text and write category metadata back with Update file properties. Microsoft documents both the file triggers and metadata-update action in its SharePoint connector reference.
The When a file is created (properties only) trigger gives file metadata. Get file content retrieves file bytes; it does not turn a PDF or Word document into classification-ready text. Your existing extraction process must finish before the classification call. If text arrives later, trigger from the ready record or use a readiness flag rather than assuming it exists at file creation.
StayCharted supplies the category prediction. Your Microsoft workflow retains responsibility for extraction, storage, indexing, permissions and metadata updates. A predicted business category is not a Microsoft Purview sensitivity label or an access-control decision.
Reuse the connection across workflows
After validating the HTTP flow, your administrator can wrap the API in a private custom connector so other flows reuse its actions and authentication. Microsoft supports custom connectors for Power Automate, Power Apps and Logic Apps. See Microsoft’s custom connector overview.
A private connector does not require a public Marketplace listing. Keep the API contract, key ownership and error handling documented. Contact support@staycharted.com for help with the StayCharted side.
Common questions
Can Power Automate call the StayCharted API?
Yes. Use an HTTP action to send prepared text to a published model and read its category and confidence. This guide describes the setup; the full flow still needs validation in your Microsoft tenant.
Does StayCharted extract text from SharePoint documents?
This workflow requires text prepared by your existing process. StayCharted classifies that input; extraction, storage and indexing remain in your systems.
Do I need a native StayCharted Power Automate connector?
No. Start with the HTTP action. You can later build a private custom connector to reuse the API across flows.
Which plans do I need?
StayCharted API access is included on Essentials and Business. Your Microsoft license must also cover the HTTP action or custom connector, and your tenant policies must permit the connection.
Full API reference → · Choose your model → · Security and your data →