How to Create a Flow to automatically insert rows into a SharePoint based on a cell value

Aina, Mike 46 Reputation points
2021-09-15T20:19:24.387+00:00

Hello Community,

I need to create a flow that will automatically insert X-number of rows in a SharePoint list when a certain value is set in the list.

Example:

A = 2
B = 4
C = 6

I set X-cell to have a value of C, as a result 6 rows are inserted below the row where I added the value of C and all data already in the row are copied down to the 6 new rows. If X-cell is set to A, 2 rows are added to list along with the preceding data. And so on and so forth.

Thank you for your help in advance!

SharePoint
SharePoint
A group of Microsoft Products and technologies used for sharing and managing content, knowledge, and applications.
9,543 questions
0 comments No comments
{count} votes

4 answers

Sort by: Most helpful
  1. CaseyYang-MSFT 10,321 Reputation points
    2021-09-16T07:22:46.607+00:00

    Hi @Aina, Mike ,

    Per my test, we couldn't use flow to insert same rows to SharePoint online list. In SharePoint Online list one row means a new item and there is no something like copy item in Microsoft flow we can only use "create item" option. So if you want to copy item in one list base on choice field this will go in infinite loop. You can see the infinite loop in the following screenshot.

    132538-1.png


    If an Answer is helpful, please click "Accept Answer" and upvote it.

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.


  2. Aina, Mike 46 Reputation points
    2021-09-20T12:28:45.147+00:00

    Hi @CaseyYang-MSFT

    No progress on the issue yet. If adding the rows and copying data to the new rows is not a SharePoint function, then we can consider this case closed.

    Thank you for looking into it!


  3. Forgo, Leah 0 Reputation points
    2023-12-04T19:19:26.5533333+00:00

    I think that this would only be in a loop if the new item is set to be A. If it is defaulted to something else then it would only add another row if the item is updated to A.

    I am having a similar issue, but I would like it to add a the number of rows that is in a specific column. If column Y has 5 then 5 new rows.

    I got around the loop issue by having a yes no column. If it is yes then it would add rows and the new rows default to no.

    0 comments No comments

  4. Forgo, Leah 0 Reputation points
    2023-12-13T17:39:28.0766667+00:00

    @Aina, Mike

    I figured it out for my issue.

    My condition sets is so if the answer is no then it will not create new items. Then my new items are all defaulted to "no". This way I don't get in a loop. Also my number of checks is already an integer so it can count it and run the "do until".

    If the row that you are using is not an integer then you might need to initialize that one as well. This is where I got the idea.
    https://powerusers.microsoft.com/t5/Building-Flows/Make-multiple-rows-on-sharepoint-list-using-one-question-from/m-p/2343697#M260662

    Hope this helps.

    User's image

    0 comments No comments