cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
8T_Bird6
Frequent Visitor

Updating existing items in a list

I feel this is very elementary, but im to new at this.

 

My flow automatically exports items from an excel table into a SP List when an "Item is created or modified".

 

The problem is that after the list populates for the first time, the next time the flow runs it says "Failed". This is because it says a duplicate value was found and it could not update list item.

 

Currently, the list itself has "Enforce Unique Values" turned ON for a column (which is needed because i cannot have duplicates). This unique value column data will not change, but the columns following it will throughout the day (This is a part tracking list showing which department a certain part is in)

 

So, even though the flow says "Failed" due to duplicate values in previous mentioned column, will it still update other columns if data changes? If not, how can i modify my flow to update list items without adding duplicates?

 

8T_Bird6_2-1633438189994.png

 

8T_Bird6_0-1633438342917.png

 

Screenshot of the list:

 

The first column "Title" has "Enforce Unique Values" set to YES within the list settings page. The second column and last column are the ones who's info will need to be updated throughout the dayThe first column "Title" has "Enforce Unique Values" set to YES within the list settings page. The second column and last column are the ones who's info will need to be updated throughout the day

 

4 REPLIES 4
ScottShearer
Super User
Super User

@8T_Bird6 

My suggestions is as follows:

  1. First, use a list rows in a table action
    1. Include a filter query so that only rows with the unique column value are returned
  2. If any rows are returned (there should either be one or none, the use an Update item action
  3. If no rows are returned use a create item action

You can check to see if any rows were returned by using a length() expression

image.pngimage.png

 

If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

Scott


@ScottShearer wrote:

@8T_Bird6 

My suggestions is as follows:

  1. First, use a list rows in a table action
    1. Include a filter query so that only rows with the unique column value are returned

 


The excel table is not the one that will have duplicates, it is the List being populated by the excel table.

 

Before i enforced unique values within list, everytime the flow ran it would upload duplicate rows of data. After enforcing unique values within list, the flow fails if the unique column value exists, eventhough the last column value data changed<<<<which is what i need. I need rows of data to update throughout the day without creating duplicates based on first column unique value.

@8T_Bird6 

OK - then use a Get Items action in place of the Get rows action with the same logic and a similar filter query.  The idea is that you want to know if a rows exists in SharePoint with that value.

I will provide an example shortly.

 

If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

Scott

Thank you very much, looking forward to it!

Helpful resources

Announcements
Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

MPA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

Learn to digitize and optimize business processes and connect all your applications to share data in real time.

Power Automate Designer Feedback_carousel.jpg

Help make Flow Design easier

Are you new to designing flows? What is your biggest struggle with Power Automate Designer? Help us make it more user friendly!

Users online (1,697)