Power Automate Apply to Each Current Item

In this Power Automate tutorial, We will learn about Power Automate Apply to Each Current Item and how to get the current item using the apply to each control action in Power Automate.

Moreover, we will also cover the below topics:

  • Power Automate apply to each current item id
  • Power Automate apply to each current item value
  • Power Automate apply to each current item index

Also, Read: Create SharePoint Online List using Power Automate

Power Automate Apply to Each Current Item

The Power Automate apply to each action to loop through an array of items. For example, we can use the Apply to each action to filter records or a list of items from the Microsoft SharePoint Online list in Power Automate.

In the following, we will see how to get the current item using apply to each control action in Power Automate.

Power Automate apply to each current item

Let us see how to get the current item value in apply to each action in Power Automate.

  • In this example, we will use the below SharePoint list, to filter and get the employee status value is active.
Power Automate apply to each current item
Power Automate apply to each current item
  • Log into Power Automate, select the instant cloud flow -> select trigger as Manually trigger a flow -> enter the flow name -> click create option.
apply to each current item in Power Automate
apply to each current item in Power Automate
  • select the +new step and add the Get items to trigger action from the action triggers.
  • Configure the SharePoint site address and list name. In the Filter Query, add the below expression to filter the employee’s active status:
Status eq 'Active'
Example of Power Automate apply to each current item
Example of Power Automate apply to each current item

Now and apply to each action from action triggers to loop through the list items, select values from the dynamic content.

Power Automate apply to each current item example
Power Automate apply to each current item example
  • Add a Compose action and pass the apply to each current item that is presented under the dynamic content values.
apply to each current item in Power Automate flow
apply to each current item in the Power Automate flow
  • Save and test the flow by selecting the run flow option. In the below screenshot, we can see that our flow ran successfully.
apply to each current item in the Power Automate flow
apply to each current item in the Power Automate flow
  • Expand the apply to each action we can see it loops and filters the 6 list items from the SharePoint list for the employee active status.
  • Now we can see the output for the current item object from the SharePoint list.
apply to each current item in a Power Automate flow
apply to each current item in a Power Automate flow

This is how to get the current item value in apply to each action in Power Automate.

Check out: How to Parse JSON Object to Array in Power Automate

Power Automate apply to each current item id

Here we will see how we can get the current item id in apply to each action using Power Automate.

In this example, we will see how we can display only the current item id from the apply-to-each control action object for the employee’s Inactive status.

  • Select the instant cloud flow -> select trigger as Manually trigger a flow -> enter the flow name -> click create option.
  • select the +new step and add the Get items to trigger action from the action triggers.
  • Configure the SharePoint site address and list name. In the Filter Query, add the below expression to filter the employee’s Inactive status:
Status eq 'InActive'
Power Automate apply to each current item id
Power Automate apply to each current item id
  • Now and apply to each action from action triggers to loop through the list items, select values from the dynamic content.
  • Add a Compose action and pass the apply to each current item that is presented under the dynamic content values.
Power Automate apply to each current item number
Power Automate apply to each current item id Example
  • Now add a compose action and under expression pass the below expression, to get only the current item id.
item()?['ID']
Example of Power Automate apply to each current item id
Example of Power Automate apply to each current item id
  • Once the flow has been saved, select the Test -> Manually -> Run flow option. In the below screenshot, we can see that our flow has run successfully.
  • To view the output, Simply Expand the Compose action in the flow and we can see apply it to each current item ID displayed as highlighted below:
apply to each current item id in Power Automate
apply to each current item id in Power Automate

This is how to get the current item ID using apply to each action in Power Automate.

Have a look: How to Check If a Date is Blank in Power Automate?

Power Automate apply to each current item Value

Let us see how we can get the current item value to apply to each control action using Power Automate.

  • Select the instant cloud flow -> select trigger as Manually trigger a flow -> enter the flow name -> click create option.
  • select the +new step and add the Get items to trigger action from the action triggers.
  • Configure the SharePoint site address and list name. In the Filter Query, add the below expression to filter the employee’s Inactive status:
Status eq 'InActive'
Power Automate apply to each current item id
Power Automate apply to each current item id
  • Now initialize an Array Variable with array type as shown below: we will use the initialized variables later in our flow.
Power Automate apply to each current item expression
Power Automate apply to each current item expression
  • Now and apply to each action from action triggers to loop through the list items, select values from the dynamic content.
  • Add a Compose action and pass the apply to each current item that is presented under the dynamic content values.
Power Automate apply to each current item id Example
Power Automate apply to each current item id Example
  • Add a new step and choose Append to array action in the Name select the initialized Variable array (VarArray) and in the values action pass the below expression to get the current item value.
item()?['Int']
Power Automate apply to each current item expression example
Power Automate apply to each current item expression example
  • Add a Compose action and pass the initialized variable array value as an input, to view the array value of the inactive employees.
Example of Power Automate apply to each current item expression
Example of Power Automate apply to each current item expression
  • Once the flow has been saved, select the Test -> Manually -> Run flow option. In the below screenshot, we can see that our flow has run successfully.
  • To view the output, Simply Expand the Compose action in the flow and we can see apply it to each current item value displayed as highlighted below:
apply to each current item value in the Power Automate flow
apply to each current item value in the Power Automate flow

This is how to get the current item value in apply to each action using Power Automate.

Check: Power Automate Condition if a String is Empty

Power Automate apply to each current item index

Let us see how to get an index for the apply to each control loop current item in Power Automate.

In Power Automate, iteration indexes work only in the do until loop, if we want to get an index value then we can change the apply to each loop to do until loop.

But there is another way to get the index of apply to each loop by creating a variable and incrementing within the loop.

To achieve this follow the below steps:

  • Select the instant cloud flow -> select trigger as Manually trigger a flow -> enter the flow name -> click create option.
  • select the +new step and add the Get items to trigger action from the action triggers.
  • Configure the SharePoint site address and list name. In the Filter Query, add the below expression to filter the employee’s active status:
Example of Power Automate apply to each current item
Example of Power Automate apply to each current item
  • Now initialize an integer Variable and pass the value as 0 like below:
Power Automate apply to each current item Value
Power Automate apply to each current item Value
  • Now and apply to each action to loop through the list items, select values from the dynamic content.
  • Add a Compose action and pass the apply to each current item that is presented under the dynamic content values.
Power Automate apply to each current item id Example
Power Automate apply to each current item id Example
  • Add a new step, select the increment variable, and choose the previously initialized variable under the name, and in the value field pass the value as 1 to increment by 1 for each loop.
Power Automate apply to each current item index example
Power Automate apply to each current item index example
  • Add a Compose action and pass the initialized variable as an input, to view the current item index value. Save and Test the flow.
Example of Power Automate apply to each current item index
Example of Power Automate apply to each current item index
  • Once the flow ran successfully, for the first apply to each current item it displays the index value as 1.
apply to each current item index in Power Automate
apply to each current item index in Power Automate
  • In the same way, for the third apply to each current item it displays the index value as 3.
apply to each current item index in Power Automate flow
apply to each current item index in the Power Automate flow

This is how to get an index for the apply to each control loop current item in Power Automate.

In this Power Automate tutorial, We have learned about Power Automate Apply to Each Current Item and how to get the current item using the apply to each action in Power Automate

Moreover, we also covered the below topics:

  • Power Automate apply to each current item id
  • Power Automate apply to each current item value
  • Power Automate apply to each current item index

Furthermore, you may like some more Power Automate tutorials:

>