- Access exercises (91)
- C# exercises (79)
- Excel exercises (278)
- Power Apps exercises (13)
- Power Automate exercises (18)
- Power BI exercises (139)
- Python exercises (28)
- Report Builder exercises (141)
- SQL exercises (198)
- SSAS exercises (51)
- SSIS exercises (46)
- SSRS exercises (99)
- VBA exercises (85)
- Visual Basic exercises (46)
POWER AUTOMATE EXERCISES▼
POWER AUTOMATE DESKTOP EXERCISES▼
Power Automate Desktop | Loops exercise | Read in an Excel list and loop over its rows only choosing some
This exercise is provided to allow potential course delegates to choose the correct Wise Owl Microsoft training course, and may not be reproduced in whole or in part in any format without the prior written consent of Wise Owl.
You need a minimum screen resolution of about 700 pixels width to see our exercises. This is because they contain diagrams and tables which would not be viewable easily on a mobile phone or small laptop. Please use a larger tablet, notebook or desktop computer, or change your screen resolution settings.
This exercise asks you to create a flow to read in the Excel worksheet in the above folder into a data table, loop over its rows and list out those billionaires who are not from the US:
A reasonably up-to-date list of the world's billionaires from Wikipedia. Your trainer is at number 12 on the list (so just not visible).
Here's what this should yield:
This should be the final text file created.
Instructions on how to go about doing this are shown below, although you're welcome to try without them if you're feeling brave!
Create a new flow called Non-US billionaires. Within this create an action to open up the workbook in the folder shown at the top of this exercise.
You only want the rows at the top, so select them and read them in:
One way to do this (as used here) is to mimic what you'd do in Excel: select cell A1, press Ctrl + A to select the contiguous block of data and then read in the selected cells. The Wait command probably isn't necessary.
When reading in the Excel data, don't forget to tick the box saying that your Excel workbook contains column headings.
Now loop over all of the data rows in the data table that you've read in. For each row you can set an intermediate variable to hold the nationality of each billionaire:
Using intermediate variables like this - while not necessary - makes code easier to write (and read).
Still within your loop, write out the name of each billionaire to a text file if the nationality isn't United States.
Test out your flow, and when it's all working save and close it!