Arrays are part of the building blocks of Power Automate. We can get arrays from many actions like the SharePoint “Get Items” action, for example. But there are a lot of times that we only want the first element of the array. So that’s where the Power Automate “first “function comes into play.

Let’s see how to use it efficiently.


It follows a simple pattern.

  1. Array to parse

Let’s start with a simple example:


will return 


How about if the array is empty.


You’ll get an error message as follows:

Unable to process template language expressions in action 'Compose' inputs at line '1' and column '6310': 'The template language function 'createArray' expects a comma separated list of parameters. The function was invoked with no parameters. Please see for usage details.'.

You always need to check if the source array is not empty. If you don’t check, your Flow will fail. Here’s a skeleton on how to do it.

I recommend using the null and length function so that you’re sure that the data is valid.

We’re using the createArray function to generate a test array, but you’ll probably use another action in your case.

Finally, let’s check if it’s a string. We can do the following:


will return


Here you can consider the string as an array of characters. The Power Automate “first “function will return the first character of the array. The same happens if there are spaces in a string.

first('Manuel T Gomes')

will return


Please don’t use this to break comma-separated strings. The split function is better at doing this. You can also check my “How to parse a CSV file” article and template for more details.


I could not find any limitations for this function, but please let me know if you do.


Here are some things to keep in mind.

Always check the array.

In my opinion, the “first” function would be a lot more valuable if it returned an empty array when the source array was empty instead of an error. By returning an error, we need to validate if the array is not empty; otherwise, the Flow will fail.

It’s not a big deal, but be sure to validate the data to avoid having failing Flows.

Don’t nest

There’s no real reason to do it, but if you find yourself in a situation where you have nested first functions in a formula, you should review it and make everything more straightforward.


Microsoft’s first Function Reference

Back to the Power Automate Function Reference.

Photo by Possessed Photography on Unsplash

Manuel Gomes

I'm a previous Project Manager, and Developer now focused on delivering quality articles and projects here on the site. I've worked in the past for companies like Bayer, Sybase (now SAP), and Pestana Hotel Group and using that knowledge to help you automate your daily tasks

View all posts by Manuel Gomes →

Leave a Reply

Your email address will not be published.