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.
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:
- SharePoint List folder action to fetch all items in that folder
- Filter array action to filter Excel files
- Apply to Each action to process all files
- List rows present in a table to bring the data
- 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:
What’s happening here? So we’re telling Power Automate to:
- For the current item.
- Try (because we have the “?”) to fetch the element “Title”
Here’s what it looks like:
After running the first time, Power Automate will even make it look like this.
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.
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.