is it possible to change the title of a file thats stored in AGOL and share it with a group using AGOL Notebooks so that i can have it running as a task
thanks
Stu
got the sharing to work using this:
gis.content.share_items(items=search_for_batch_reports, groups=['5e................e68'])
just noticed that in your example you used
gis.content.get but when i use that it returns nothing but gis.content.search returns my file...
thanks @Anonymous User i tried that but got a slightly different error, is it because i am trying to share a Survey123 word document with a group rather than feature
search_for_batch_reports = gis.content.search("H..............1") print("Search result: ", search_for_batch_reports) search_for_batch_reports.share(groups=['5edd............e68'])
--------------------------------------------------------------------------- AttributeError Traceback (most recent call last) <ipython-input-4-1e3c6c4eb4e2> in <module> ----> 1 search_for_batch_reports.share(groups=['5e.............e68']) AttributeError: 'list' object has no attribute 'share'
Hi Stuart, it appears your syntax is correct from what you've shown. See below for a working example. Is it possible your 'fc_item' variable isn't a valid item? What is 'search_for_batch_reports[0]'?
Regarding changing the title of an item, see the below code. Also see the relevant documentation here (note: it appears the example given here is broken - you cannot pass description, title, etc. as arguments. They must be inside a keyvalue pair dictionary): https://developers.arcgis.com/python/api-reference/arcgis.gis.toc.html#arcgis.gis.Item.update
LMK if you have any more questions.
Josh
so i tried this to share my content
fc_item = search_for_batch_reports[0] fc_item.share(groups=['5edd............e68'])
but all i get is this:
--------------------------------------------------------------------------- TypeError Traceback (most recent call last) <ipython-input-61-44a9c5ed5fef> in <module> 1 fc_item = search_for_batch_reports[0] ----> 2 fc_item.share(groups=['5edd............e68']) TypeError: 'dict' object is not callable
Los miembros registrados pueden publicar, seguir actualizaciones y más. ¿Nuevo aquí? Regístrate gratis.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.