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.

Software ==> Power Automate Desktop  (18 exercises)
Version ==> Latest version
Topic ==> Loops  (3 exercises)
Level ==> Average difficulty
Subject ==> Power Automate training
Before you can do this exercise, you'll need to download and unzip this file (if you have any problems doing this, click here for help).

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:

List of billionaires

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:

The list of final people

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:

Selecting block of data

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:

Nationality variable

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!

You can unzip this file to see the answers to this exercise, although please remember this is for your personal use only. Our Power Automate exercises answers are provided as text files - you can see how to assemble these back into PAD flows here.
This page has 0 threads Add post