How to use portalItem.update

165
2
05-14-2021 01:46 PM
CristianPoputea
New Contributor

Hello everyone I'm trying to figure out how to use 
portalItem.update()

Unfortunately I can't find any documentation on the structure on how a layer is required.
Currently I'm trying to add a layer, in particular this layer:

https://ngmmi.maps.arcgis.com/home/item.html?id=c91bdcb084374ae9851c5986dad6cda7

I'm fetching the layer information using PortalGroup

portalGroup.queryItems()

After this I'm adding the layer into the my current webmap and everything seems to work.
But after I'm saving the new webmap using the api below and passing the new operational layers with the newly added layer.

portalItem.update()

 The layer is not appearing into the legend for some reason.

My main problem is the lack of documentation and structure with the portalItem.update() api

Here is the docs I've research into:
https://developers.arcgis.com/rest/users-groups-and-items/update-item.htm
Unfortunately "text" field has no documentation 😞 

0 Kudos
2 Replies
DavidPike
MVP Frequent Contributor

Sounds like a nightmare, only think I can offer is line 342 here ArcGIS-REST-API/API REST ArcGIS.postman_collection.json at master · esri-es/ArcGIS-REST-API · GitHub

CristianPoputea
New Contributor

thanks for the link, unfortunately it's hard to find anything useful about this topic 

0 Kudos