I'm running a script from a Notebook in Pro to update a couple of items. The description, terms, etc work, but I'm stuck on the thumbnail. Is it possible to use locally stored images, or images hosted on another server?
This is the code I use for the other parameters, e. g. the description:
from arcgis import GIS
gis = GIS("home")
desc = "this is a test"
test_item = gis.content.get('267cf15c2030453b94e6259822948fd6')
item_properties={"description":desc}
test_item.update(item_properties)
Parameter "thumbnailurl" won't work with either local nor hosted images.
Reference: https://developers.arcgis.com/rest/users-groups-and-items/common-parameters.htm
So what does it look like when you are specifically attempting to update the thumbnail? In particular, how are you formatting the filepath? I have done this with local files, and have had no issues with it.
Like this:
item_properties={"description":desc, "thumbnailurl":"D:\Temp\img\globe_200x133.png"}
or
item_properties={"description":desc, "thumbnailurl":"https://i.imgur.com/qRyvWoR.png"}
I also tried parameter "thumbnail", and file:\\\ for the local image.
Hi @LR2
You add the thumbnail directly in the update method. for URL below.
test_item.update(thumbnail="https://i.imgur.com/qRyvWoR.png")
This will also work for filepaths, just remember the r in front of the string if using backslashes.
test_item.update(thumbnail=r"D:\Temp\img\globe_200x133.png")
Easy enough. Works like a charm. Thanks!