I have a className called SearchPreferences and it is empty until the current user makes a selection. When they make a selection a new row is created in this class with the updated info. The problem is if the user goes back and makes another selection I am creating a new row again instead of just updating the column. Here is the code that is saving the info but on a new row:` 

```
let music = PFObject(className: "SearchPreferences")

    music["music"] = table_data[indexPath.row]

    // music["user"] = PFUser.currentUser()!.username!

    music.saveInBackgroundWithBlock{(success, error) -> Void in

        if error == nil {

            music.saveInBackground()
            print("success")
        } else {

            print("error")
        }
    }

```

`
All I can find is SQL and PHP online help. I tried the code below to call objId but I don't know it as its empty so it returns the below error.
The code below returns the error 

> 
> No results matched the query. (Code: 101, Version: 1.7.5)
> 
> 
> 

```
 let query = PFQuery(className:"SearchPreferences")
    query.getObjectInBackgroundWithId("musicSearch") {
        (searchPreference: PFObject?, error: NSError?) -> Void in
        if error != nil {

            if let searchPreference = searchPreference {
                searchPreference["musicSearch"] = self.table_data[indexPath.row]
                searchPreference.saveInBackground()

                if error == nil {

                    query.whereKeyDoesNotExist("musicSearch")

                    let searchPreference = PFObject(className: "SearchPreferences")

                    searchPreference["musicSearch"] = self.table_data[indexPath.row]

                    searchPreference.saveInBackgroundWithBlock{(success, error) -> Void in

```

The same can be send for this attempt:

```
    var query = PFQuery(className:"SearchPreferences")
    query.getObjectInBackgroundWithId("musicSearch") {
        (searchPreference: PFObject?, error: NSError?) -> Void in
        if error != nil {
            print(error)
        } else if let searchPreference = searchPreference {
            searchPreference["musicSearch"] = self.table_data[indexPath.row]
            searchPreference.saveInBackground()
        }
    }

```

I am trying to figure out how to either before running the query check if it is empty and if it is carry out my initial query. Parse docs only tell you how to save to classname \_User not a second classname.