Will updating a smart list with new filters overwrite existing filters?


#1

Hi there,

I’m looking at creating/updating Smart Lists using the API.

If I update an existing smart list with new filters will this overwrite the previous filters, or will it amend the new filters on top of the previous filters?

If you need more information please let me know.

Thanks.


#2

Hi @Adam_Sinclair

Setting any value for the "filters" property in the request JSON would overwrite the filters with the new value, not append the value to the existing filters. If you’re trying to append a new filter, you’d need to add that filter to the current filter settings before updating the list with the combined filters data.


#3

Thanks @dadams

I just want to confirm what you’re saying so I know I understand correctly.

Here are the steps to appending a new filter:

  1. Get request to receive desired list.
  2. Store current filters of said list in a variable using JSON format.
  3. Append any additional filters to the variable.
  4. Send the update request with newly created variable containing old and new filters.

Does that sound correct?


#4

@Adam_Sinclair yep, that sounds correct to me.