take function in Power Automate

In this exercise, we will learn how to use the take function of power automate. The take function is used to return the first count of elements from the array. The array is given as the first argument and the count is given as the second argument in the function.

Let’s create an array variable with name FirstArray, as shown in the image below.

take function in Power Automate

To see the output, we are using the Compose action of power automate. Use the dynamic expression given below to get the first count of elements from the array.

Power Automate

take(variables('FirstArray'),2)

We can see the output in the compose action that only the first two elements are returned in the output.

take function in Power Automate