cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Sahara22
Post Patron
Post Patron

repeating same first item in sharepoint list.

Hello I have a flow that copies information from an excel sheet on my onedrive that's constantly updated and I have a issue that When it writes to the sharepoint list, it will only copy the first entry in the excel sheet then repeat the same entry over and over again. I have over 900 different entries. Any idea where would the mistake be? If I do this manually (create items, it works, but takes over 15 minutes) 

 

Please see picture of flow below: 

 

81EAC0B3-E2BA-45DC-9C0C-C6C10F8FBA31.jpeg

1 ACCEPTED SOLUTION

Accepted Solutions
abm
Super User
Super User

Hi @Sahara22 

 

image.png

 

Remove the above steps, the inner loop and move the settings and Generate SP data under the first loop.

 

Select only expects the array of the values. Here you have mapped the emp name under the loop hence you got  another loop. Also I can't see your first very first apply each 2?  Is that reading from another Excel sheet? If its the same excel sheet then all you need is Get List rows and your select actions steps. Without seeing the full flow its difficult to give an exact answer.



Did I answer your question? Mark my post as a solution!

If you liked my response, please consider giving it a thumbs up


Proud to be a Flownaut!

Learn more from my blog
Power Automate Video Tutorials

View solution in original post

12 REPLIES 12
Sahara22
Post Patron
Post Patron

It's like a constant loop, it wont stop until i cancel the flow ... Im not sure what I did, but like i said, if I use the "create items" and not use the script it works.

abm
Super User
Super User

Hi @Sahara22 

 

image.png

 

Remove the above steps, the inner loop and move the settings and Generate SP data under the first loop.

 

Select only expects the array of the values. Here you have mapped the emp name under the loop hence you got  another loop. Also I can't see your first very first apply each 2?  Is that reading from another Excel sheet? If its the same excel sheet then all you need is Get List rows and your select actions steps. Without seeing the full flow its difficult to give an exact answer.



Did I answer your question? Mark my post as a solution!

If you liked my response, please consider giving it a thumbs up


Proud to be a Flownaut!

Learn more from my blog
Power Automate Video Tutorials

Thank you fr replying back @abm ,

 

Here is the pic for the flow from the beginning, so the reason why I have this set up, because the table ID of the excel sheet constantly changes. So are you saying that I don't need "list rows"? Hope this picture helps you better to understand. Thank you again so much!!  

 

 

Sahara22
Post Patron
Post Patron

I removed those to actions and now i get an Error saying: 

 

"The execution of template action 'For_Each_row_in_the_Excel' failed: the result of the evaluation of 'foreach' expression '@body('List_rows_present_in_a_table')' is of type 'Object'. The result must be a valid array." 

 

The expression I used for EMP_ID  is 

items('For_Each_row_in_the_Excel')?['EMP_ID']

Do I need to write this differently then because I removed it? 

Sahara22
Post Patron
Post Patron

What the flow looks like now : 

 

 

Sahara22
Post Patron
Post Patron

Any idea's?

Hi @Sahara22 

 

What's the first step for? Do you have more than one tables in your Excel sheet?

 

 



Did I answer your question? Mark my post as a solution!

If you liked my response, please consider giving it a thumbs up


Proud to be a Flownaut!

Learn more from my blog
Power Automate Video Tutorials
Sahara22
Post Patron
Post Patron

No only one table. but it changes because the excel file is updated constantly so the table would get an error saying" could not find table" that's why I have to do "get tables".  

Hi @Sahara22 

 

What is that action step settings2?

 

Thanks



Did I answer your question? Mark my post as a solution!

If you liked my response, please consider giving it a thumbs up


Proud to be a Flownaut!

Learn more from my blog
Power Automate Video Tutorials

this one? 

 

 

Sahara22
Post Patron
Post Patron

This is the top of the flow, hope this makes it easier for you.  I have a flow that deletes then replaces info. 

 

 

Sahara22
Post Patron
Post Patron

@abm Thank you for you help. It was because I had the second loop, thats why it was repeating the same entry. Removed looped and it works now. Thank you.

Helpful resources

Announcements
Power Automate News & Announcements

Power Automate News & Announcements

Keep up to date with current events and community announcements in the Power Automate community.

Community Calls Conversations

Community Calls Conversations

A great place where you can stay up to date with community calls and interact with the speakers.

Power Automate Community Blog

Power Automate Community Blog

Check out the latest Community Blog from the community!

Top Solution Authors
Top Kudoed Authors
Users online (4,046)