There is a method called
getScope() in ReportMetadata Class. Can someone please shed some light on what 'Scope' actually means? Where/how is it specified? What are the possible (API/system-digestible) values?
Returns the API name for the scope defined for the report. Scope values depend on the report type.
I am trying to update report metadata via REST API. Upon GET, I see that the metadata returns something called
"scope":"organization" in JSON. After making a couple column API name changes, I POST the request back to save changes to server. Sadly, I get an error response saying
"scope":"organization" is invalid. Because I couldn't find much documentation around it, I did some random GETs on other reports and noticed that some returned
"scope":"team" instead. I then tried updating a report that has
"scope":"team" and it worked without complaining. Now I am worried if that is OK to do? I am hoping this doesn't cause more grief than good. I don't see any visual differences in the report after the change, though. Thoughts?
I just figured that 'Scope' relates to a report being public or private. More info here.
Supported Query Scopes
Use these scopes to help specify the data your SOQL query returns.
allPrivate Records saved in all users’ private folders. Requires the user permission "Manage All Private Reports and Dashboards" and Enhanced Analytics Folder Sharing. If your organziation was created after the Summer ’13 release, you already have Enhanced Analytics Folder Sharing. Available in API version 36.0 and later.
created Records created by the user running the query.
everything All records except records saved in other users’ private folders.
mine Records saved in the private folder of the user running the query.
organizationOwned Records saved in Unfiled Public Reports. In Lightning Experience, the Unfiled Public Reports folder is called Public Reports.
But now, how do I know the actual value to pass to the REST API endpoint? Like I mentioned above, the values from what I gathered based on the reports in our org so far are
useronly (definitely not an exhaustive list).