web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Create Sharepoint List...
Power Automate
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

 



Categories:
I have the same question (0)
  • WillPage Profile Picture
    2,307 Super User 2025 Season 2 on at

    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

  • CCoatesAU Profile Picture
    8 on at

    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

  • Verified answer
    WillPage Profile Picture
    2,307 Super User 2025 Season 2 on at

    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

    Thanks Will,   that worked.  

     

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 525 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 324 Moderator

#3
abm abm Profile Picture

abm abm 232 Most Valuable Professional

Last 30 days Overall leaderboard