Share and Enjoy !

Anyone who has paid attention to the press releases coming out of Microsoft recently will be aware that they have gone all-in on AI. Microsoft is branding its version of the ChatGPT-powered AI assistant “Copilot”, and it is being applied to nearly all Microsoft products.

Low-code/no-code offerings, such as Power Automate, already promise to reduce the barrier of entry and empower a large cohort of “makers” to generate technical solutions for their various workloads to increase efficiency and reduce mistakes. Copilot takes this further by allowing a maker to generate solutions with plain text prompts. In this blog post, I will be sharing some of my findings while attempting to use Power Automate Copilot to generate a reminder email for myself.

Introduction

Internally, ThreeWill has adopted EOS (Entrepreneurial Operating System). As part of this, we have weekly L10 meetings to review current metrics and discuss issues. For these meetings, I own a scorecard metric to report how many blog posts we have in the marketing queue to ensure that we have a consistent presence online.

Recently, I had forgotten to populate my scorecard metric, which was quite embarrassing. To try to prevent this in the future, I wanted to build a Power Automate Flow to send me a reminder email with the number of items in the queue so that I could quickly populate the scorecard. I thought this should be a simple flow so it could be an excellent opportunity to try Power Automate Copilot to get some AI assistance creating it.

Generating a Power Automate Flow using Copilot

As of the current time, Power Automate Copilot is still in preview. To use the full features of Power Automate Copilot, you will have to be in an environment that is in the region “Preview (United States)”. For my testing, I created a Trial environment in the Power Platform admin center.

Note: You can use some of the features even if you aren’t in a preview environment. See the section “Using Copilot outside of a preview environment”.

If you are in such a region, when you arrive at the Power Automate home page you will see a prominent section for Power Automate Copilot.

To get started, simply enter a prompt. This is my first attempt at building out a Flow using Copilot so I will just try to simply describe what I’m trying to do.

Prompt:

Send me an email on Wednesday morning with a count of the number of items in the list “Blog Post Schedule” where the “ApprovalDate” field is not blank and the “PublishDate” field is blank or in the future.

This resulted in a suggested flow that was not quite what I was expecting. There are several more actions than I would have thought, however, the basics seem right – I see that there is a Recurrence action, an action to Get Items from SharePoint, and an action to Send an Email – so let’s see how this goes.

Note: If the suggested flow is not what you were expecting, you can select “This isn’t what I’m looking for” to see an alternative. In this case, two options were created (as denoted by the “1 of 2” in the screenshot below), however, they didn’t really look meaningfully different in this case, so I stuck with the first.

Clicking “Next” brings up a page to check the required connectors for the Flow. Everything looks good so I will continue by clicking “Next”.

It seems like there are some pieces of information that Copilot was not able to discern from my prompt. I didn’t specify where the SharePoint list lives, and I didn’t provide any details about the email I want to generate, other than I wanted it sent to myself which it unfortunately didn’t pick up. I selected the proper SharePoint site; however, I left the email details blank for now as I will attempt to use Copilot to help me populate them in the next step. I clicked “Next” to create the flow.

And just like that, I have a Power Automate Flow. The flow opens in the new Copilot experience, with the actions that make up the Flow in the center and the Copilot chat window on the right side. There is a panel on the left that will show the details of each action as you select them.

First, let’s see what was created. There is a Recurrence action to start this Flow on a schedule. Here are the details.

Unfortunately, it doesn’t look like Copilot was able to understand that I want this to run on Wednesday mornings. Let’s see if we can fix that.

Start the Flow at 9AM every Wednesday

Copilot says that it updated the Recurrence, however it seems that the only thing that updated was the start time, oddly set to January of last year. I ultimately tried several different prompts to get Copilot to set the Recurrence to run on Wednesdays but I didn’t have success. That is a bit disappointing, but it demonstrates that as impressive as these new AI tools are, there is still room for improvement. I will do this piece manually.

Looking at the rest of the steps, the Flow appears to get all the items from the SharePoint list, initialize a count variable called “InitializeVariable”, then loop through all the returned items to check a condition. If the condition is true, it increments the counter variable and oddly gets my profile (this is clearly the wrong place for this as it will run multiple times), and finally sends the email.

The Condition action’s filter criteria looks like it was interpreted correctly, however it didn’t populate the field names.

I had used the internal names in my query so perhaps that is why. I wasn’t sure how to describe how to fix it and it was easy enough, so I quickly selected the appropriate fields manually.

Next, I asked Copilot to move the Get my profile action to the correct place.

Move the Get my profile action after the Foreach action

Unfortunately, it didn’t quite do what I was expecting (actually it made things worse!), only moving it to the end of the Foreach action rather than outside of it.

Let’s try one more time.

Move the Get my profile action to be just before the Send an email action

Ok, that got what I wanted. I probably should have done this sooner but let me change the name of the variable to be more meaningful. I tried a couple of different prompts without success; Copilot simply returned the name I was requesting without modifying any actions.

 

I finally found a prompt that was understandable by Copilot. I didn’t realize that I had a typo in this command (and the one before it), but Copilot figured out what I wanted!

Change the name InitializeVariable to NumberOfBlogsInQueue

 

This highlights how sensitive Copilot can be to different prompts. The inclusion of the word “of” made the statement unrecognizable, but it is potentially able to handle some misspellings.

Lastly, let’s fill out some of the email information. I want to see how Copilot does with complex instructions.

Add the result of the Get my profile action to the Send an email To field. In the text of the email, generate a template for a weekly reminder email that sends the count of the number of blogs that are in the marketing queue. The title of the email should be “Blogs in the Marketing Queue”. The number of blogs is the value of the variable NumberOfBlogsInQueue.

Well, it generated a template for me, but it didn’t update the Send an email action. I added the details manually using the text Copilot generated. Copying the details into the designer did not resolve the dynamic fields, so I had to add those manually.

I guess all that is left is to test it.

Dealing with errors

Unfortunately, the flow failed on my first attempt, which is not too surprising, but what did surprise me is that the Copilot debug interface does not appear to have an output to describe any errors encountered. The only way that I could find to get more information about the error was to revert to the old-style Flow testing interface without Copilot. Maybe there is something I missed, otherwise, this seems like a significant oversight.

In the old debug view, the error message is clear.

It seems that I had a type mismatch in my condition. I resolved the issue and was able to run the test successfully!

Refining the query

As I just described above, I was able to successfully build a Power Automate Flow to send me a reminder email, which is great, but there’s one problem – this is not a very good Flow. In my opinion, this Flow is overly complicated for what I’m trying to do, and, beyond that, it is not very performant. This Flow is returning all items from the SharePoint list and then looping through them one at a time to get the count. There are far more efficient ways to perform this task. This is where prompt engineering comes into play.

Ultimately, the best result I achieved was from the prompt below:

Send me an email every Wednesday morning at 9AM with a count of the number of items in the list “Blog Post Schedule” from the SharePoint site https://threewill.sharepoint.com/teams/marketing

This got me really close to what I was looking for: This Flow was correctly set to run at 9AM on Wednesdays, properly identified the SharePoint list I wanted to pull items from and it even created an email template for me. There was of course no filtering on this one as I didn’t mention it in the prompt (more on this later), but the immediate result was not bad without any intervention, and so much faster!

I tried to use Copilot to add the filter, but it resulted in the only error I experienced during my testing.

However, simply adding an ODATA filter to the Get Items action gave me my ideal Flow.

Resulting email:

Using Copilot outside of a preview environment

Even if you are not in a preview environment, you can still start using plain text prompts to build a Flow by navigating to the “Create” page and selecting the option “Describe it to design it (preview)”.

This opens a page with an open text entry (there is also an option to choose from some predefined options). From there, you can go through similar steps to create the Flow as outlined above, however, you will not get any Copilot assistance to edit once the Flow is created.

Issues

Through all my attempts at writing prompts, I had some persistent issues. It is important to remember that this technology is very new and Power Automate Copilot is still in preview. I hope that it can improve in some of these areas over time. Also, it is worthwhile to check the official documentation for Power Automate Copilot for some additional information and instructions on how to write a good prompt.

Filtering lists

Filtering a SharePoint list was an issue for me throughout my testing. For the most part, Copilot attempted to add Query actions after the Get Items action, which is not ideal from a performance perspective, and even then they were never exactly right. Copilot was also fond of adding Compose actions seemingly for no reason.

When I explicitly provided the OData query that I wanted to add to the filter, Copilot did apply it automatically, but frustratingly, even though the prompt only differed from my best attempt by adding this additional statement, it didn’t correctly identify the SharePoint site. (Also, note an example of the phantom Compose action with this one).

Send me an email every Wednesday morning at 9AM with a count of the number of items in the list “Blog Post Schedule” from the SharePoint site https://threewill.sharepoint.com/teams/marketing using the ODATA filter ApprovalDate ne null and PublishDate eq null or PublishDate ge ‘@{ formatDateTime(utcNow(),’yyyy-MM-ddT00:00:00Z’)}’

Email template text

I tried various methods to provide the text I wanted for the email in the prompt, however, I was never successful with this.

Recurrence

This was probably the most surprising thing. I figured Copilot would have no problem configuring the Recurrence to run as specified, however, as I detailed above it was not foolproof.

Conclusions

As with any innovative technology, I think expectations should be tempered. The examples that Microsoft has curated look amazing, but in reality, the results were a little less impressive in my experience. There is no doubt that it is incredible to enter a prompt and get something that works, however, we have not reached the place where a computer can be reliably programmed using only plain text.

On the other hand, this technology will only get better with time and this is another step towards empowering even more employees to create solutions that allow them to thrive.

If you are interested in Power Automate Copilot, or Power Automate and the Power Platform in general, to empower your employees to streamline their workflows and improve employee experience, Contact ThreeWill today!

EMPOWER YOUR EMPLOYEES TO STREAMLINE THEIR WORKFLOWS AND IMPROVE EMPLOYEE EXPERIENCE TODAY!

Share and Enjoy !