0

I'm trying to get a list of items of a view with only the fields I need because I don't need all the fields of each item.

from pypodio2 import api

podioID = os.environ.get('PODIO_ID')
podioAPIKey = os.environ.get('PODIO_APIKEY')
podioUser = os.environ.get('PODIO_USER')
podioPassword = os.environ.get('PODIO_PASSWORD')

app_id = xxxxxxxx
view_id = xxxxxxxx
limit = 1
offset = 0
attributes = { "limit": limit, "offset": offset, "filter": required_fields }

c = api.OAuthClient(podioID, podioAPIKey, podioUser, podioPassword)
events = c.Item.filter_by_view(app_id, view_id, attributes)

I have too many fields in each item, and in the result I don't see all the fields, only a couple of them and I don't have all the fields I need in the fields of the answer.

I'm not understanding very well the documentation about getting only the fields I want. I tried different things and none of them worked.

Last one, and doesn't seem correct is with the attributes value.

required_fields = {
    'mappings': [
      {"field_id": xxxxxxxxx}, # field 1 that I need
      {"field_id": xxxxxxxxx}, # field 2 that I need
      {"field_id": xxxxxxxxx}  # field 3 that I need (and up to 14 fields that I need)
    ] 
}

How I should do it to get the fields? Some of that fields are not event in the unfiltered response.

Marcus Müller
  • 34,677
  • 4
  • 53
  • 94
Alex
  • 1,230
  • 2
  • 24
  • 46

0 Answers0