December 18, 2024

If you’re not a developer, the concept of “comments” can be new, but any developer friend will tell you that they are essential or not needed at all. I’m being a little bit ironic, but comments are polarizing within the community if they are essential or not. Comments are pieces of text that tell us the intention behind the block we’re using. Most of the time, this can be obvious, but in more cases, the “obvious” part can hide details that can enable mistakes from our side. In my opinion, spending 5 minutes writing the motivation behind something can save a lot of time in the future, even if the actions are super simple.

Let’s explore them, how they can be written, and how to do them in Power Automate.

Where can you find them?

You can find the feature to add a comment is in every block in Power Automate. To add a new one, click the “…”, and then select “Add a comment.”

Power Automate will add a line with any sort of text that you want to insert.

In the example above, we’re creating a trigger to start the Flow when a new email arrives. It’s quite simple, but you have underlying options that you can select that have a reasoning behind them, which may not be as obvious. Things like, “why did we select it to trigger with no attachments? We want all email don’t we?”. Questions like these are a waste of time if you have a simple comment stating, “Fetching all emails with attachments because we want to save them in a folder in OneDrive”. It takes 5 minutes, and “future you” will thank you when you’re reviewing this Flow in 6 months, and you have no idea why action is setup the way that it is.

Why use them?

I touched on this before, but good comments make or break your app. We’re using low-code, meaning that we don’t do any “actual” code to get the results we want, but Flows can become quite complex quite quickly. With comments on your blocks, you can have hints of the intention at the time. But use them wisely:

  1. Use them frequently, but only if you have something to add. If the trigger is “When an email arrives,” and you write in the comment “Triggers when a new email arrives,” your comment won’t add much to the context you already know.
  2. Keep it short. If a comment is a full description of the history behind the decision to use that action, it’s not useful because no one will read it. Add all the elements that you need but keep it as short as possible.
  3. Add details regarding the component that are configured inside. In the example above, we can add that only emails with attachments should be used. With this, if we open the Flow later and the “Include Attachments” and the “Only with Attachments” are set to “No” or empty, then you’ll know that something’s wrong.

Final thoughts

I hope you can understand the power (no pun intended) of comments in your Flows with this simple example. “Future you” won’t know the details and, worse, “future someone else” may is completely lost because they don’t understand the purpose of a specific action. Be kind to any of them and add comments that provide actionable information.

Have a suggestion of your own or disagree with something I said? Leave a comment or interact on Twitter and be sure to check out other Power Automate-related articles here.

Photo by Clayton Robbins on Unsplash

Manuel Gomes

I have 18 years of experience in automation, project management, and development. In addition to that, I have been writing for this website for over 3 years now, providing readers with valuable insights and information. I hope my expertise allows me to create compelling, informative content that resonates with the audience.

View all posts by Manuel Gomes →

2 thoughts on “Power Automate: Comments

  1. I’ve noticed that if you save an action to your clipboard and add a copy of it elsewhere in the same flow, and subsequently add a comment to either the original action or the copy, that both actions display the comment icon and both link to the same comment. I assume that’s not intentional behavior? Using the … peek code, it looks like copied actions share the same metadata.operationMetadataId value.

  2. Thank you for this article. I am new to Power Automate but have a little coding experience. In my version, it calls comments notes instead. Can you update the article to mention that? I got a little confused because you can also add comments on each trigger or action but they are not the same as the kinds of comments you discuss in this article.

Leave a Reply

Your email address will not be published. Required fields are marked *

Mastodon