Flow Designer giving a Unique Key violation detected by database ((conn=867010) Updating User ID

Stephencroc
Kilo Guru

I have an interesting situation.  I have a flow that is an effort to keep Okta from duplicating user accounts.  Here is what I mean.  If there is a user named bross (which has a sys_id) then Okta has a "PersonID" that has the Okta unique value added.  Okta will bring in the user and append a number to the end of it, so we would have bross and bross1.  This is generally a duplicate as far as the user is concerned due to the Okta ID being the same.  What we are tying to do to mitigate the problem is create a flow that will look to see if there is already a sys_user record with the parentID the same as what is being inserted.  If there is we want to update the original record with the new information and delete the newly created record okta put in.  This is due to HR module already knowing about the person and other things in the mix. 
However, I have an Update record step in Flow Designer that is set to update the User ID with the new information.  I get a Unique Key violation detected by database ((conn=867010) Duplicate entry <then it spits out the name> and the flow fails.  We do have to update to the new value Okta is putting in there for our 2fa requirements.  Anyone know how to get through this?


I have attached the Flow design.  If you try this you can do an insert and stay and you will see it create a new record and fail on the duplicate value error in the flow.
Needed for setup:
1.  Add a PersonID field to the sys_user record as a string.  Update the record with this as a value for the selected user:  I used Abel Tutor.  PersonID: 1qyonw7jMyJlxWjgDMkfiXL3j7ZZJaXquJh4vFDL

Here is the flow as well:  

Desired result:  When updating the original record it should reflect the new User ID.  That is the field I'm having difficulties with.

1 ACCEPTED SOLUTION

Stephencroc
Kilo Guru

I was able to update and fix my own problem,  Thanks

 

View solution in original post

2 REPLIES 2

Stephencroc
Kilo Guru

Updating the above Flow;  I have removed the unneeeded fields and it's only now the User ID and the Email.  Easier for testing.

Please do not use the first update set for the flow!!!

Stephencroc
Kilo Guru

I was able to update and fix my own problem,  Thanks