I am doing a query of my Portal Items like below and get the result like below.
I want to take this a bit further and test the "Item Title" and only process a few of the returned items
search_result = source.content.search(query="owner:"+str(source_owner), item_type="Web Map")
for item in search_result:
app=source.content.get(item.id)
data = [app]
print(data)
Result
[<Item title:"AAH Demo Public" type:Web Map owner:someone>]
[<Item title:"AAH Demo" type:Web Map owner:someone>]
[<Item title:"AAH Demo Live Test" type:Web Map owner:someone>]
[<Item title:"AAH Demo" type:Web Map owner:someone>]
How would I get Item title to a variable?
print(data.title)
or something like that..... Not sure how to read that returned format into anything????
thoughts
Solved! Go to Solution.
for item in search_result:
print(item.title)
The list search_result already has the title as a property of each Item in it. You can reference the title directly in your loop.
for item in search_result:
print(item.title)
The list search_result already has the title as a property of each Item in it. You can reference the title directly in your loop.