Select to view content in your preferred language

Reload PortalItem

304
0
05-02-2023 11:33 PM
JoëlHempenius3
Frequent Contributor

Using the ArcGIS Pro SDK, I'm reading PortalItem properties, such as Title, Description, thumbnail etc.

The PortalItem is retrieved from the Portal using the following code:

PortalQueryParameters query = PortalQueryParameters.CreateForItemsWithId(itemid);

                PortalQueryResultSet<PortalItem> results = await ArcGISPortalExtensions.SearchForContentAsync(ArcGISPortalManager.Current.GetActivePortal(), query);
                

 

The workflow of the end user using the Addin is in some scenario's:

  1. Search for the PortalItem in ArcGIS Pro and display title, thumbnail etc 
  2. Modify the PortalItem outside of the Pro SDK, using the Portal for ArcGIS HTML UI or the ArcGIS API for Python, this modification includes setting a new thumbnail (which changes the thumbnail URL on the Item)
  3. Search for the same PortalItem again in ArcGIS Pro and display title, thumbnail etc again

Im running into some problems at step 3. It seems that the Portal Item information is cached somehow, because the properties (especially the thumbnail URL) are not updated when the search is executed for the second time. I will get the old thumbnail URL, which is invalid after the thumbnail update after step 2, and cannot download or display the thumbnail using the URL specified on Portalitem object in the result list. 

Therefore, I'm looking for a method to refresh the PortalItem properties from the Portal, but I don't see it. Is there a way to refresh the properties of a PortalItem object? 

 

-Joël Hempenius.

Languages: JavaScript, Python and Dunglish
Tags (1)
0 Kudos
0 Replies