top of page
Writer's pictureJon Russell

Create a list items using an array in Power Automate

Morning all,


I came across this post on the Power Automate forums:


"Title: Create a list items using an array in Power Automate


Hello Power Users,

 

I have a sample array in the below format and would like to loop. through it to create list items inside a SharePoint list.

 

Array :  ["AAA, BBB, CCC",

              "DDD,EEE,FFF",

               "GGG,HHH,III"]

Can anyone please help!

 

Thank you so much in advance!"


Ok, lets take a look.


First of all, create a new flow, call it whatever you want, I have gone with the post title. I have created, and instant flow, as I think that is easiest here.


The next step is to create an Array variable:


Step 1 Initialize ArrayVariable

Your flow will look like this:


Flow progress so far


Next initialize another variable, call it Index, type = Integer and a value of 0, like below:

Step 2 Initialize Index variable

Next add an Apply to each, for the Select an Output from Previous Steps, select the ArrayVariable:


Step 3 - Apply to each

Inside the Apply to Each step, add an Increment variable, and choose Index, and increment it by 1:



Step 4 - Increment Index variable

Next add a compose:


Step 5 - Compose current item

The inputs will be the Current item, you ca write this as an expression if you want as item()


Finally, add your outputs of the compse (within the apply to each) to your SharePoint site:


Step 6 - Create item in SharePoint

This will then create the items in the SharePoint list you have selected:


Result in SharePoint

The beauty of this method is that you can have as many items in your array at the start for example:


I have added more lines to the ther ArrayVariable:



Adding additional lines to the Array

And hey presto, all of the items have been added:


Result in SharePoint after more array items have been added

Here is the full flow end to end:


Power Automate cloud flow structure end to end, all steps

4,126 views1 comment

Recent Posts

See All

1 Comment


Angelika Wartina
Angelika Wartina
Oct 21, 2024

Mastering Assignments: Tips and Strategies for Academic Success


Assignments are an integral part of the academic journey, allowing students to demonstrate their understanding, creativity, and ability to apply concepts. However, juggling multiple assignments, deadlines, and other responsibilities can be challenging. With proper planning, strategic thinking, and efficient study habits, students can excel in their coursework. This guide provides essential tips and strategies to help you master your assignments and enhance your academic performance.

Understanding the Assignment Requirements

The first step towards completing any assignment successfully is to thoroughly understand the requirements. Carefully read the assignment guidelines, paying attention to the instructions, marking criteria, and the specific question you need to address.

For those who find it difficult to grasp the…


Edited
Like
bottom of page