When using the Wix Members Area app, prevent duplicate member Display Names (nicknames) from being created by members

Question:
When using the Wix Members Area app, prevent a duplicate member Display Name (nickname) from being created by a member.

Product:
Wix Studio

What are you trying to achieve:
I want the member Display name to be the unique identifier of the member so when a member enters data into forums and groups, they are uniquely identified. I need a way to validate the member display name when a member updates their profile. I’d like to prevent them from using a name that is currently being used by another member. It appears that the out-of-the-box functionality will allow multiple users to have the same Display Name and therefore appear like the same member in Forums and Groups.

What have you already tried:
Data Hook validation

Additional information:

That didn’t work? Show your code?

This is my code in data.js.

export function MemberLocationStats_beforeUpdate(item, context) {
console.log(“Before MemberLocationStats update”)
}

export function Members$FullData_beforeUpdate(item, context) {
console.log(“Before Members$FullData update”)
}

Before I update the MemberLocationStats table, “Before MemberLocationStats update” prints to console.

Before I update the Members$FullData table, nothing prints to console.

At this point, I’m just trying to capture the update action of the member data.