Changing constituent preferred address

I am trying to do some data cleanup using SKY API. We have a situation where through invalid imports we had some of the existing preferred addresses replaced by new, empty ones. 



I used SKY API PATCH Address in Constituent API to update "preferred" field on the Alternate record and while it changed it to Preferred, the empty address disappeared. 


I queried the database for the import ID of the "empty" constituent address record - record no longer exists. It looks like the empty address was deleted from the database without actually using DELETE endpoint. While it is somewhat helpful in the sense that we would eventually want to delete the empty addresses, I feel like deleting them without user's control is not entirely appropriate. Is that an intended behavior?


It also seems like only empty records are getting deleted that way. When I changed the "preferred" flag between two complete, non-empty addresses, both the old preferred became the new alternate. 


I noticed another interesting thing too. Trying to change ONLY the preferred flag on the address record that for some reason doesn't have country code returns error 400 - country code not found, even though I am only trying to change "preferred" field and "country" is not part of the request. 

 

Comments

  • Anthony Gallo
    Anthony Gallo Blackbaud Employee
    Tenth Anniversary Kudos 5 Commented in Discussion First Reply
    Hello Szymon,

    We are looking into this but it might be intentional logic due to the fact that RE7 allows for a blank address.  The team is going to dig a bit deeper here to see if we can get you any more details.  

    Anthony
  • Anthony Gallo
    Anthony Gallo Blackbaud Employee
    Tenth Anniversary Kudos 5 Commented in Discussion First Reply
    OK, this is expected functionality here.  We added some code to cleanup blank addresses in 2016.  We can see that if you are updating an address to be primary and the previous primary address was blank, we will remove that blank address completely.  We used to run into a situation where we would have multiple blank addresses in the database and in an effort to clean up this situation, this method was born.  

Categories