Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Automate - Building Flows
Answered

Create Sharepoint List Item - Unique Value Failure

(0) ShareShare
ReportReport
Posted on by 8

Hi Power Automate Community,

I have built a flow that gets attachments sent to a shared mailbox, saves them in OneDrive, uses AI to read the invoices, add the details into a SharePoint list then email the submitter to notify on a successful/failed row creation.

 

Now here is where the issue lays, the SharePoint list has two columns that are set to "must contain unique values" to ensure duplicates are not created, which is causing the "Create Item" action to fail (that is to be expected as I don't want it to succeed and have configured run after to notify the user that the record was not created.).   

 

The problem is that if this step fails (which it will do if duplicate invoices are sent to the mailbox) the Entire flow shows as failed.
Is there a way to mark the flow as successful, even if that one step fails?

CCoatesAU_0-1711496887660.png

CCoatesAU_1-1711496961480.png

 

CCoatesAU_3-1711497050958.png

 



  • CCoatesAU Profile Picture
    8 on at
    Re: Create Sharepoint List Item - Unique Value Failure

    Thanks Will,   that worked.  

     

  • Verified answer
    WillPage Profile Picture
    2,042 on at
    Re: Create Sharepoint List Item - Unique Value Failure

    I see. In that case, initialize an integer variable at the top of the flow with a starting value of 0. Within the loop, in the branch of your flow that handles the Create item error, do an increment variable action and add 1 to the integer variable.

    Now, below the loop, put a condition that the integer variable is > 0 with run after set to only if failed. Within the yes branch of the condition, add a terminate action Success and in the no branch make it Failed. That way if the apply to each has failed but the integer is zero then the reason it failed is unrelated to the Create item failing and it will exit with Failed, but if the counter is more than 0 then it failed because of the Create item, which you already handled so you can exit with status = Success.

     

    This will work if you don't have different causes of the failure in the different iterations of the loop. You can be way more granular with your error control by using multiple integer variables or an array variable which you can append items to in the run-after = failed for each of the actions inside the loop then process that at the end, like turn it into a HTML table and email it to the support team or whatever.

  • CCoatesAU Profile Picture
    8 on at
    Re: Create Sharepoint List Item - Unique Value Failure

    Sorry @WillPage  if this question is dumb, but won't that mark the flow as successful if any of the actions in the "Apply to each" fail?
    I do need to see failures, but just not on the Create Item action

  • WillPage Profile Picture
    2,042 on at
    Re: Create Sharepoint List Item - Unique Value Failure

    Yup. Simply add a Terminate action at the end of the flow set to Successful and set its run after Apply to each - attachment = success or failed

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Paul Stork – Community Spotlight

We are honored to recognize Paul Stork as our July 2025 Community…

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Announcing the Engage with the Community forum!

This forum is your space to connect, share, and grow!

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 497 Super User 2025 Season 1

#2
David_MA Profile Picture

David_MA 436 Super User 2025 Season 1

#3
Riyaz_riz11 Profile Picture

Riyaz_riz11 244 Super User 2025 Season 1