Quickly add multiple items in SharePoint list using power automate – more than 5000

Quickly add multiple items in SharePoint list using power automate – more than 5000

No comments

 37 total views,  9 views today

In this “Add multiple items in SharePoint list using power automate” article, we will learn how to create multiple items (more than 5000) in a SharePoint Online list using Power Automate.

Add multiple items in SharePoint list using power automate (more than 5000 items) – business needs

For many reasons, we need to have a list with more than 5000 items for the threshold limit scenario test, or for the query performance test. Using PowerShell script we can create multiple items very quickly in the SharePoint list, in this tutorial, we will add multiple items in the SharePoint Online listing using Power Automate.

Here is the flow to create more than 5000 items in the SharePoint Online list.

Create more than 5000 items in SharePoint list using Power Automate
Create more than 5000 items in the SharePoint list using Power Automate

Flow Explanation: Add multiple items in SharePoint list using power automate

This is a manually triggered flow. It has two sections:

  • Variable declaration
  • Do Until Loop

Variable declaration section

Initialize below two variables:

  • intVarItemCount – Integer Type with initial value 1. This number is the starting number of the loop.
  • strVarItemTitleToBeCreated – String Type, This will be passed in the Title column as value
Initialize variable in auto increment number in power automate
Initialize variable in auto increment number in power automate

Do Until Loop Power Automate: Auto increment number in power automate to add multiple items in SharePoint list

Below is the Do Until loop section.

Do Until Loop - Auto increment number in power automate to add multiple items in SharePoint list
Do Until Loop – Auto increment number in power automate to add multiple items in the SharePoint list

Explanation of Do Until Loop Power Automate

Step 1:


@variables('intVarItemCount') is equal to 5000

In change limit, count is equal to 5000

Changes limit in Do Until Power Automate loop
Changes limit in Do Until Power Automate loop

Notes:

  • The default change limit is 60, you must change to the desired number you want to create in the list.
  • For example, we have given the number 5000, however, you could give any positive number which is less than or equal to 5000. More than 5000 numbers, will not accept.
  • This number count control how many items should be created in the list.
  • If you want to create more than 5000 items in the list, then you need to execute this flow more than once or you need to execute this in batch.

Step 2:

Add a compose action and add the “intVarItemCount” variable in it.


@{variables('intVarItemCount')}

Add compose action Power Automate Do Until Loop

Step 3:

Add compose action to convert the number to a string. Add the below value to the compose action.


string(outputs('Compose_-_Item_Sequence_Number'))

Add compose action to convert number to string

Add compose action to convert number to stringStep 4: Add a set variable action for the “strVarItemTitleToBeCreated” variable. And using the Concat function add two strings (‘Item_’ and ‘incremented number).


concat('Item_',outputs('Compose_-_Convert_item_sequence_to_string'))

Concat function add two string in Power Automate

The Concat function add two string in Power AutomateNote:

  • Here we created the item title as “Item_1”, “Item_2”, and “Item_3”, etc. However, you could give some other values. Here the “Item_” part is fixed and the number part is dynamic (auto-incremented).

Step 5:

Add a create item action and pass the below parameters:

  • Site Address – Your site address
  • List Name – Your list name
  • Title – Title column value passes from the previous step (strVarItemTitleToBeCreated)
  • ItemCreateChannel – This is a choice column in our list in which two values (Power Automate, Manual), pass Power Automate to indicate the item has been created from the Power Automate.
Create item action in Power Automate to create multiple items in SharePoint Online list
Create item action in Power Automate to create multiple items in the SharePoint Online list

Step 6: Final step

Increment the “intVarItemCount” variable by 1. For that add increment variable action.

Add increment variable to auto increment number in Power Automate
Add increment variable to auto increment number in Power Automate

That’s it we are done with the flow. Now let’s run the flow manually as this type of manually triggered flow. Then, take a break, then see the status, you could see that 5000 items have been created in the list. For us, the time took to create 5000 items using this Power Automate flow was 00:52:53.

Create more than 5000 items in SharePoint list using Power Automate – Demo

We could see that 5000 items have been created in the list ‘AddMoreThan5KItems’.

Create more than 5000 items in SharePoint list using Power Automate - Demo
Create more than 5000 items in the SharePoint list using Power Automate – Demo

Summary: Add multiple items in SharePoint list using power automate (more than 5000 items)

Thus, in this article, we have learned how to add multiple items in the SharePoint Online list using Power Automate by auto-incrementing numbers inside the do until loop.

See Also: Power Automate Tutorial

You may also like the below Power Automate tutorials:

 

About Post Author

Do you have a better solution or question on this topic? Please leave a comment