XeroAPI/xero-python

(Solved) getItems request filtering — swap quotation mark for the `where` variable

abitamaspp opened this issue · 1 comments

I want to get items where the Name's value starts with "Penamping" (eg.: "Penamping - Alam Sutera - DOUBLE" and "Penamping - Karawang - DOUBLE"). Using API, I can filter my request by with ?where=Name.StartsWith(%22Penamping%22) (see the screenshoot below)

image

That's neat, but I can't get same result when using the SDK. I've tried some 'variations', yet none of them work:

  1. where = "Name.StartsWith('Penamping')" and where = "Name.StartsWith(Penamping)" will give me all items

  2. Explicitly assign where param with the above where variable give me Bad Request response

image
(Penamping quoted)

image
(Penamping not quoted)

What should I assign to the where variable? The docs doen't even tell or list accepted string for that variable.

PS: My app can still run without filtered result, but I think it's not a good thing to retrieve the whole 1274 items every time it run.

Okay, turns out I haven't try to swap quotation mark for the where variable. This 'variation' works for me :)

image