New Power Automate GPT Connector
Tags: gpt3, powerautomate, powerplatform, lowcode
Published: 2023-07-17 07:13:26

There are lots of ways to get Chat GPT power into your flows, but before they require OpenAI and a custom connector. But now there is a new connector out of the box and ready to go with no effort.

![create text with GPT](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/hy70u91j7k48q3u0g24q.png)

The `Create text with GPT` is an AI builder connector, but there are a couple of points to consider

- It's in preview so might change
- As its preview its free, which is great but we don't know how much it will cost
- Requires environment feature ins settings 'AI Builder Preview Models' turned on
- This is GPT not Chat GPT, so same model but hosted by Mircosoft not OpenAI
- Again as its in preview so little documentation around token limit

That a side, its pretty cool, and it solves problems that only a Human in the Loop could of (Check out my previous blog on why Human in the Loop is so Powerful [here](https://dev.to/wyattdave/power-automate-the-power-of-human-in-the-loop-1fp8))

---

To use the connector we need to create the prompt we are going to send to the model, we can paste it directly in or, the easier way, use the prompt templates.

![ai connector](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/thcm4bskp9o3q1dso5jq.png)

The connector has 4 default templates and create from blank.

![gpt prompts](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/rask9fh5wnw6ulbq7h5r.png)

The templates are based on prompts, and though they cover the most used there are many more.

1. Summarize Text
2. Extract Information
3. Classify Text
4. Create Blog
5. All the rest (Create from blank)

---

## 1. Summarize Text

![create prompt](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/laparhlkj2emuxowcbzr.png)

As you can see we have 4 main parts of out prompt creator

- Prompt
- Question/Key Data
- Fail threshold and action
- Context text

In this template its

- Summarize
- Less then 2 paragraphs without adding new information
- If less than 1 paragraph return 'can't summarise a text that is too short'
- #include your text here

So to use it we would change '#include your text here' to our input text.

We can test the model to make sure it's right and make edits to any of the parts.


![test prompt](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/jzdw1xa6akdfvgdgfeqb.png)

**Context text -** [https://powerautomate.microsoft.com/en-us/blog/announcing-public-preview-of-customer-managed-encryption-keys-for-power-automate/](https://powerautomate.microsoft.com/en-us/blog/announcing-public-preview-of-customer-managed-encryption-keys-for-power-automate/)

**Summarized Test -** This text announces the public preview of Customer Managed Encryption Keys (CMK) for Power Automate. CMK provides customers with added control over their data, especially for highly regulated industries like Healthcare and Financial Services. It allows customers to leverage an encryption key from their own Azure Key Vault and apply it to any Power Platform environment. Additionally, admins can "lock" an environment to ensure total lockdown of their data.

## 2. Extract Information

![extract info](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ge0fe2w602fg5c80jb9c.png)

Extract has the same 4 parts, but in this example changed to:

- Extract 
- Container numbers and registration numbers
- If less than couple of words, answer that you can't extract information. 
- We are pleased to inform you that the shipment clearances for....

If we test with the same context text from here [https://powerautomate.microsoft.com/en-us/blog/announcing-public-preview-of-customer-managed-encryption-keys-for-power-automate/](https://powerautomate.microsoft.com/en-us/blog/announcing-public-preview-of-customer-managed-encryption-keys-for-power-automate/) we get:

**Extracted text -** Author: Rakesh Krishnan
Where to send questions and feedback: Power Automate Community

![extract info demo](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ac6fa4e79y0cdl6hlajc.png)

pretty cool 😎

## 3. Classify Text

![classify text](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/t6g2znlf2x5pdfcfrk0k.png)

You can see the pattern; we just change our main parts, like prompt. 

![categorise](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/noffy1uwk437dsvktvyt.png)

## 4. Create Blog

![create blog](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/uiddp81lolkur8wm2rj6.png)

Again same pattern, but this one shows how far you can push the 'Question/Key Data' to get as precise as you need.

![blog demo](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/gxn8vaueeyz2grvahslc.png)

**Context text -** [https://powerautomate.microsoft.com/en-us/pricing/](https://powerautomate.microsoft.com/en-us/pricing/)

**Summarized Test -** Power Automate is an incredibly powerful tool that can help businesses automate their processes and tasks, saving time and money. With Power Automate, businesses can choose from a variety of subscription plans to best fit their needs. 

The per-user plan is great for individuals who want to automate cloud apps, services, and data with digital process automation (DPA). This plan allows people to create and run unlimited flows for just $15 per user/month. 

For businesses that need to automate legacy apps on a desktop, the per-user plan with attended RPA is the best option. This plan includes the same capabilities as the base plan, plus the ability to automate legacy apps on a desktop via robotic process automation (RPA) in attended mode for $40 per user/month. 

For businesses that want the flexibility to pay only when a person runs a flow connected with premium connectors, the pay-as-

_Not bad effort with the notoriously difficult Microsoft Licenses_

## 5. All the rest (Create from blank)

![blank prompt](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/o3kzfuvkbqpxp218j9xh.png)

After using it a few times you will find yourself using the blank more often, as you can see the structure is consistent and easy to follow without templates.

![find demo](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/0p2g0dqnz6bbyi4e169y.png)

I use 'Find' for answering questions like above for [https://powerautomate.microsoft.com/en-us/pricing/](https://powerautomate.microsoft.com/en-us/pricing/)

You can also translate

![translate demo](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/vqlvjhksw3m9z2lzby5y.png)

Count/Sum

![sum demo](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/1ttddpmpiwsdqm1ox0rt.png)

and much much more, you are only limited by the prompts you can think of.

![code demo](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/rjur7j4afevc6azzc0qf.png)

Yep it even writes code, that works too 😎
{% codepen https://codepen.io/WyattDave/pen/abQYzwW %}

---

Chat GPT was democratized AI, I think `Create text with GPT` connector democratizes AI to Low Code and Power Automate Developers

---

**Further Reading**

- Inspired by [https://dev.to/balagmadhu/the-yoda-guide-2nd1](https://dev.to/balagmadhu/the-yoda-guide-2nd1)
- Documentation [https://learn.microsoft.com/en-us/ai-builder/prebuilt-azure-openai](https://learn.microsoft.com/en-us/ai-builder/prebuilt-azure-openai)