View the original community article here
Last tested: Sep 17, 2020
- Get the existing query using the
look
endpoint - Create a new query with the updated filter value using the
create_query
endpoint - Use the query id from the response in step 2 to update the look using
update_look
More resources:
Updating Look via API
Update Look with Filters in Python
Example with Python SDK:
### GET QUERY ID FROM LOOK
query = sdk.look(look_id=44).query
##CREATE NEW QUERY AND ADD A FILTER
new_query = sdk.create_query(body=models.WriteQuery(model="dogs_of_new_york", view=query.view, fields=query.fields,
filters={"dog_names_of_nyc.count":100}))
### UPDATE LOOK WITH NEW QUERY ID
sdk.update_look(look_id=44,body=models.WriteLookWithQuery(query_id=new_query.id))
###RUN LOOK
result = sdk.run_look(look_id=44,result_format="csv")
print(result)
This content is subject to limited support.