How to update useraccount with username validation „if record exists“

Hi,

i have a problem with a Serverconnect Update Form and the correct validation setting for username.

My userupdate form needs the ability to change username and password.

How do I correctly create a form to update a username? I have the validation „if record exists in database“. My problem is the validation of the username if there is no change of the username.

I get a validation message that the username already exists. What i need to know is how to set the condition if there is no change, not to validate.

Thanks a lot for your help in advance.

Marcel

@MH2ag,

Try this and see if it works. In your update query, put your post variables in the condition field. There are two types of conditions in the query builder. The one I am referring to is the one on the Columns and Values tab.

1 Like

Hi Marcel,

This is how I go about it when I let users update their email address which is used for security login:

I search the users table to get the email address of the logged in user:

If the email address of the logged in user is the same as the email address from the POST, then skip the validation. Otherwise, if the email address has changed, perform the validation requiring it to be unique:

–Ken

3 Likes

Thanks @scott and @mebeingken for your help,

@scott, I tried your approach, but it does not work for me.

@mebeingken, I will try this. I think that should do what I want. I thought that there would be an easier way :slight_smile:

Marcel

2 Likes