AnsweredAssumed Answered

How to update the tags on a user's portal item via the api?

Question asked by David.Wendelken on May 25, 2017
Latest reply on May 25, 2017 by David.Wendelken

I'm using the extract data widget to create extract files.  It writes these files to the logged in portal user's content.

 

I want to tag the items that were just created but I can't find anywhere in the api that lets me do that.

 

Example of what I want to do:

var myUrl = 'somevalue';  // I know this value at runtime, so not a problem.
var myItemId = 'someOtherValue'; // Ditto.

var thisPortal = new arcgisPortal.Portal(myurl);
thisPortal.signIn().then(function (loggedInUser) {
    loggedInUser.getItem(myItemId).then(function(theItem) {
         // I want to add a tag to the item so I know it's ok to automatically toss it a day later.
         theItem.tags[theItem.tags.length] = 'Delete in One Day';
        // I want to write the item back to the portal.
        // And I cannot find any documentation on this step!
    })
});

Outcomes