When constructing a Logic Apps that gets information from a SharePoint list you will use the SharePoint “Get Items” action. This action allows you to get items from a SharePoint list you connect the action to. You can then process the items by using for example an Azure Function. Constructing a flow this will give you the following Logic App.
By default Logic Apps will construct a foreach loop after the “Get Items” action that you cannot see in the designer view. By opening the code view you will see it (It will only appear if you added a value of the “Get Items” action to for example the input of the Azure Function).
This means that the Azure Function will be called for every item that is retrieved by the “Get Items” action meaning that if the action retrieves 100 items the function will be started 100 times.
In a Logic App a colleague (Andre de Ruiter) of mine was constructing he wanted to process all the items at ones in a Azure Function. By default this isn’t possible because the Logic Apps designer only gives you the option to add specific fields into the input value.
As you can see in the above screenshots the action retrieved all the fields available on the SharePoint item and does not give a option to add the complete body of the “Get Items” action.
If you want to send the complete body trough you will have to use de code view. The easiest way is to add one output from the “Get Items” activity into the input of your action and then click on “Code View”.
Within this view search for the Azure Function or the other action that is being called. You will notice that this action contains the foreach object.
Remove the line with the foreach and in the “inputs” object change the body value to: “@body(‘Get_items’)”. Your action will know look as followed.
Open the “Designer” again and notice that the Action now contains the “body” element of the “Get Items” action.