Select to view content in your preferred language

Query for item_type with OR operator

372
1
06-13-2019 11:04 AM
Don_Barker
Emerging Contributor

I'm barely using the ArcGIS API for Python to find AGOL/Portal items with specific attributes.  I can't see how to use the gis.get.content function with an OR operator.  Like, I want to fetch Portal items that are 'Feature Service OR Map Service'.  Can you point the way?

Thanks.

0 Kudos
1 Reply
JakeSkinner
Esri Esteemed Contributor

Hi Don,

I don't think you could do an OR operator, but you could iterate through a list of item types.  Ex:

item_types = ['Feature Layer', 'Map Image Layer']
for item in item_types:
    layer_result = target.content.search('title:LightningStrikes', item_type=item)
    print(layer_result)
0 Kudos