#Flow – How To iterate through collections of elements (#Excel, #Sharepoint, and more…)

Hello!

A very common scenario when we work with Microsoft Flow is to work with collections of elements. These may be rows in Excel, Sharepoint lists, or other collections. Usually, in these scenarios, we tried to do is to work individually with each one of the items in the collection.

If we use an Excel as an example, we can see that we have the action “Get Rows”. This action opens an Excel file, reads a table and returns a pointer with the collection of rows in the Table. The next thing we have to do is select an action of type “Apply to Each” which will allow us to iterate through the elements of the collection.

In the next picture, we can see a couple of steps in a Flow definition. Start with open an Excel file, then select the output from the previous step named “Value”. “Value” represents each of the rows in Excel the table opened in the previous step.

clipboard07

The next thing is to work with every “value”. For example, insert the contents of the Excel table into a Sharepoint list.

Note: Here we miss functionality as the of AutoMapper (link), which in the case of entities in the .net saves us a lot of work.

 

clipboard05

We can think of a different scenario, where we need to conduct any assessment for each row in Excel, for example, single recording rows that match a value “Monday” for the day at Excel column in Sharepoint.

clipboard09

And, if an IF not enough also you can test your monitor resolution with a fantastic graphic SWITCH!

clipboard11

Greetings @ Toronto

El Bruno

References

Advertisements

30 thoughts on “#Flow – How To iterate through collections of elements (#Excel, #Sharepoint, and more…)

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s