October 13, 2024

Power Automate: No Dynamic Content? No problem.

Once in a while, we try to add content using the “dynamic content,” but we either see it empty or don’t see what we need. There are a few reasons for this to happen, so today, let’s look at some examples of the most common and see how to fix them.

Not configured

The most common reason is that we don’t have the required fields filled-in something yet. For example, let’s look at SharePoint’s “When an item is created” trigger. We add it to our Flow and try to access some of the information in the “Compose” action.

Power Automate doesn’t display the information. Why? Notice that the “When an item is created” trigger is not pointing to any site and list. So Power Automate doesn’t know what information to fetch. Now let’s configure it.

Much better. So the first thing to check is if the action where we want to fetch data has, at least, the mandatory fields filled in. If they aren’t, fill them in first and try again, regardless of their type. It works for all Power Automate actions.

Only know when running.

Another example is when we don’t see what we need because Power Automate can only know the information once it’s running. For example, let’s say that we want to fetch all files in an Excel file folder and get the data from one column. For the sake of the exercise, let’s assume that all Excel files have a table with that column. So we do the following:

  1. SharePoint List folder action to fetch all items in that folder
  2. Filter array action to filter Excel files
  3. Apply to Each action to process all files
  4. List rows present in a table to bring the data
  5. Compose action to fetch the title

Don’t worry too much about the details. I want to show it to you in the end, but if you’re interested in a template doing this, please let me know on Twitter.

The issue here is that we know that Excel contains a “Title” column, but since Power Automate is not linked (yet) to an Excel, it cannot possibly know its structure.

The solution is to do it ourselves

But we have the items function that can help us fetch the information. The items function will contain the current item processed by the “Apply to Each” action in a JSON format. So we can do something like this:

items('For_Each_row_in_the_Excel')?['Title']

What’s happening here? So we’re telling Power Automate to:

  1. For the current item.
  2. Try (because we have the “?”) to fetch the element “Title”
Please note that the capitalisation is important for either the item function while referring to the apply to each action, but also to the column in Excel. If you define “title” in the function, the Flow will fail.

Here’s what it looks like:

After running the first time, Power Automate will even make it look like this.

Pro Tip:

If you don’t remember the format to build the expression, don’t worry. Run it once and then go to the run history. Click on a successful run and open the “List rows present in a table” action.

There you can see what is returned, and you can copy the column name to your expression. This way, you’ll always know that the name is correct.

Final thoughts

These are two examples, but there are more. If you have a sample, please let me know, and I’ll be happy to include it here.

What’s important is to understand why things are not displayed. Once you know this, it will be a lot easier to fix the issues in the future.

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 Mayer Tawfik 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 →

4 thoughts on “Power Automate: No Dynamic Content? No problem.

  1. And if you have to use the result of an action multiple time, you can force Flows to expect the columns you need.
    Simply use a “Parse Json” action :
    – In “From” : put the body of the action you want.
    – In “Schema” : generate the schema using the result of the action you want.
    Then Flows will list all fields of the action in the Dynamic content !

    This is briefly explained here : https://techcommunity.microsoft.com/t5/microsoft-365-pnp-blog/how-to-use-parse-json-action-in-power-automate/ba-p/2121861

  2. Hi,
    I am sorry if my question seems to be a stupid one… I am a newbie to Power Automate.
    My flow is to send the creator of the record an e-mail notification before the start date starts. I am able to insert the StartDate in the subject line; but when I try to compose the e-mail to include both the StartDate and the EndDate, I am not able to find these 2 in the Dynamic Content. What can goes wrong please?

    The sequence of the flow is:
    Recurrence–>Get Items–>Apply to each (select an output from previous steps: Value)–> Condition (where StartDate+2=today’s date)–> if YES then Send an email(V2).

    the e-mail notification works, it is just the 2 fields mentioned are not able to be included in the body of the e-mail. Can you please help? Thank you

    1. Hi!
      No worries at all. We’re all learning :).
      That’s indeed strange. You should see the date columns in the “Dynamic Content” from SharePoint. You can then format them so that the data shows correctly.
      The only reason not to show up is if it’s not a supported value, but if you’re sure these fields are “dates” in SharePoint, then it should be ok.
      Is there a way to share some print screens so I can try to understand what could be wrong? You can email them to manuel@manueltgomes.com.

Leave a Reply

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

Mastodon