Is there a way of filtering only the deceased in the Constituent API

597b86adda717113f610a39bf63f0251-huge-sc


Currently the method that filters the deceased gets every single constituent and then they are filtered via array_filter (PHP). Is there a way of just filtering the results to show only the deceased constituents? There is no request parameter in the Constituent List https://developer.sky.blackbaud.com/docs/services/56b76470069a0509c8f1c5b3/operations/ListConstituents that does this specific request. Thanks

Comments

  • Hi Josh, 


    Good question!  At the moment, there is no parameter you can provide that will limit the results to ONLY deceased constituents.


    One workaround you could use is to leverage the List functionality within NXT:
    1. Create and save new constituent list with the Include deceased filter unchecked - save it with a name of "Living constituents"
    2. Create another new constituent list, this time with the Include deceased filter checked (along with any other criteria you need)
    3. Click the Add/Exclude button, choose "Exclude from list", and select the list you created in step 1.  
    4. Save the list as "Deceased constituents"
    Now, using the GetLists operation (with list_type = "constituent") in the List SKY API, you can find the id of the "Deceased constituents" list you created in step 4.


    You can then provide that value for the list_id parameter of the ListConstituents operation within the Constituent SKY API.  The results of that API call will be ONLY deceased constituents.


    A caveat to note is that the list exclusion described above would only be accurate as of that particular moment in time.  Any new constituents added (whether deceased or not) will show up in the Deceased Constituents list.


    Hope this helps!