How to get an item from a list using Power Automate Desktop?

In this Power Automate desktop tutorial, we will see how to get items from a list using Power Automate Desktop.

So, here we will cover the below topics, which will give you an idea of how we can get an item using the index in Power Automate Desktop. These topics are:

  • Get the first item from the list.
  • Get the first few items from the list
  • Get specific items from the list
  • Get the last items from the list

Get the First Item from a List in Power Automate Desktop

Here, we will see how to get the first items from the list on the Power Automate desktop.

For example, we have a list called names containing [Alex, Ron, John]. To get the first item i.e. Alex, we will pass the index as 0 with the last name, so our expression will be Names[0].

Step 1: Open the Power Automate desktop, provide the flow name, and click on the Create button.

How to get items from the list in Power Automate Desktop

Step 2: Now we will create a List variable called Names, so, expand the variable section. Then drag and drop the Create new list action to Canvas and provide the below information:

  • Now provide the new list name as Names, then click on Save.
Power Automate Desktop get items from the list

Step 3: Next, we will add names to the list, for this, expand the variable section, then drag and drop the ‘Add item to list ‘ action to canvas. Then provide the below information:

  • Add item: Provide the item name ‘Alex’.
  • Into List: Click on the variable icon {x} -> select Names, then click Save.
Microsoft Power Automate Desktop get items from the list

Similarly, add the other items/names to the list of Names. Next, we will fetch the first item from the list. So here I have added two more names to the list i.e. Ron and John.

Using Microsoft Power Automate Desktop get items from the list

Step 4: Now we will get the first item from the list, so expand the Message box section and then drag and drop the Display Message action to the canvas. Then provide the below information:

  • Message box title: Provide the title like below.
  • Message to display: Provide the below code as a message to display.
%Names[0]%
Using Microsoft Power Automate Desktop get first item from the list

Step 5: Now run the flow by clicking on the run button, and you can see the message box will pop up with the first item in the list.

Power Automate Desktop get first item from the list

This is how we can get the first item from the list in Power Automate Desktop.

See also  Power automate SharePoint multiple choice column to string

Get First Few Items from a List using Power Automate desktop

Here, we will see how we can get the first few items from the list in Power Automate Desktop.

For example, we have a list called names containing [Alex, Ron, John]. To get the few items from the list, we must provide the start and stop indexes. To get Alex and Ron, we can use this expression Names[0,2].

Step 1: Open Power Automate Desktop, provide the flow name, and click on the Create button.

How to get items from the list in Power Automate Desktop

Step 2: Now we will create a List variable called Names, so, expand the variable section. Then drag and drop the Create new list action to Canvas and provide the below information:

  • Now provide the new list name as Names, then click on Save.
Power Automate Desktop get items from the list

Step 3: Next, we will add names to the list, for this, expand the variable section, then drag and drop the ‘Add item to list ‘ action to canvas. Then provide the below information:

  • Add item: Provide the item name ‘Alex’.
  • Into List: Click on the variable icon {x} -> select Names, then click Save.
Microsoft Power Automate Desktop get items from the list

Similarly, add the other items/names to the list of Names; next, we will fetch the first item from the list. So here I have added two more names to the list i.e. Ron and John.

Using Microsoft Power Automate Desktop get items from the list

Step 4: Now we will get the first 2 items from the list, so expand the Message box section and then drag and drop the Display Message action to the canvas. Then provide the below information:

  • Message box title: Provide the title like below.
  • Message to display: Provide the below code as a message to display.
%Names[0:2]%
Power Automate Desktop get first few items from the list

Step 5: Now run the flow by clicking on the run button, and you can see the message box will pop up with the first item in the list.

Microsoft Power Automate Desktop get first few items from the list

This is how we can get a few items from the list in Power Automate Desktop.

See also  How to Save Microsoft Forms Responses and Attachments to SharePoint Lists using Power Automate?

Gets specific items from a list in Power Automate desktop

Here, we will see how to get specific items from the list in Power Automate Desktop.

For example, we have a list called names containing [Alex, Ron, John]. To get the specific item i.e. Ron, from the list, we need to provide the index of the specific item and stop index. To get Ron, we can use this expression Names[1,2].

Step 1: Open Power Automate Desktop, provide the flow name, and click on the Create button.

How to get items from the list in Power Automate Desktop

Step 2: Now we will create a List variable called Names, so, expand the variable section. Then drag and drop the Create new list action to Canvas and provide the below information:

  • Now provide the new list name as Names, then click on Save.
Power Automate Desktop get items from the list

Step 3: Next, we will add names to the list, for this, expand the variable section, then drag and drop the ‘Add item to list ‘ action to canvas. Then provide the below information:

  • Add item: Provide the item name ‘Alex’.
  • Into List: Click on the variable icon {x} -> select Names, then click Save.
Microsoft Power Automate Desktop get items from the list 2

Similarly, add the other items/names to the list of Names; next, we will fetch the first item from the list. So here I have added two more names to the list i.e. Ron and John.

Using Microsoft Power Automate Desktop get items from the list

Step 4: Now we will get the specific item from the list, so expand the Message box section and then drag and drop the Display Message action to the canvas. Then provide the below information:

  • Message box title: Provide the title like below.
  • Message to display: Provide the below code as a message to display.
%Names[1:2]%
Microsoft Power Automate Desktop get specific items from the list

Step 5: Now run the flow by clicking on the run button, and you can see the message box will pop up with the first item in the list.

Power Automate Desktop get specific items from the list

This is how we can get specific items from the list in Power Automate Desktop.

Get the Last Item from a List in Power Automate desktop

Here, we will see how to get the last item from a list in Power Automate Desktop.

For example, a list called Names contains [Alex, Ron, John]. To get the last item i.e., John, from the list, we need to provide the index of the last item. To get Ron, we can use the expression i.e., Names[2].

See also  How to Convert XML to SharePoint List using Power Automate?

Step 1: Open Power Automate Desktop, provide the flow name, and click the Create button.

How to get items from the list in Power Automate Desktop

Step 2: Now we will create a List variable called Names, so, expand the variable section. Then drag and drop the Create new list action to Canvas and provide the below information:

  • Now provide the new list name as Names, then click on Save.
Power Automate Desktop get items from the list

Step 3: Next, we will add names to the list, for this, expand the variable section, then drag and drop the ‘Add item to list ‘ action to canvas. Then provide the below information:

  • Add item: Provide the item name ‘Alex’.
  • Into List: Click on the variable icon {x} -> select Names, then click Save.
Microsoft Power Automate Desktop get items from the list 3

Similarly, add the other items/names to the list of Names; next, we will fetch the first item from the list. So here I have added two more names to the list i.e. Ron and John.

Using Microsoft Power Automate Desktop get items from the list

Step 4: Now we will get the last item from the list, so expand the Message box section and then drag and drop the Display Message action to the canvas. Then provide the below information:

  • Message box title: Provide the title like below.
  • Message to display: Provide the below code as a message to display.
%Names[2]%
Power Automate Desktop get last item from the list

Step 5: Now run the flow by clicking on the run button, and you can see the message box will pop up with the first item in the list.

Microsoft Power Automate Desktop get last item from the list

This is how we can get the last item from a list in Power Automate Desktop.

Conclusion

In this Power Automate Desktop, we saw how to get an item from a list using Power Automate Desktop. I have also explained how to get specific items from a list using Power Automate desktop.

You may like the following Power Automate desktop tutorials:

>