How to refer to fields

I am wondering what to do with the fields variable in the example use code in the Update Look (https://github.com/llooker/python_sdk/blob/master/docs/LookApi.md#update_look) page. Do I list the fields I want to change, or each field?

More specifically, in using the Update Look request, where can I input new values into a filter? I have a filter that is already there that I want to fill with new data. Is there an example of how I could go about adding new data into a field or is this impossible?

I think you’d have to first get the look, store the filters, and add to them— And then insert the full list into the update look request. Just adds one more step!

And to confirm, there are no current examples of accessing the api in order to run a look in Python correct (using the SDK)?

There’s an example of run_look specifically here: https://github.com/llooker/python_sdk/blob/master/docs/LookApi.md#user-content-example-4

I’m looking for an example that works with filters more, update_look has fields but not filters.

Gotcha, I don’t think we have an example of that full flow currently, but I wrote something about a similar case here:

If you get_look, you can see the filters array that you’ll need to add your filter information to.

Thanks Izzy, I appreciate your persistence in helping me out.

Reading this I understand better what I need to do, but I do not understand how to pass filters through update_look. Update_look seems to only take fields as an argument, not filters. What am I missing there?

Ah sorry I was unclear / skipped a step.

You can’t directly update the filters, rather you have to create a new query. So the workflow would be:

  1. get_look() on the relevant look and extract the query object
  2. Edit that query body (make sure to remove the ID) to have your modified filters.
  3. Pass that new body into “create_query” which will return a query_id
  4. Pass that query ID into the update_look endpoint, {"query_id": 1234567}

Sorry for being unclear earlier! Does that help?

I believe it will, it makes sense on the try it out page, but I first need to troubleshoot my authentication issue I posted about here: Error 401: Unauthorized