2

I have a unique requirement where i need to find which reports are subscribed by which user in our org. Is there any specific app which can help here or any other suggestions.

2
  • While feature are you using for report subscriptions - Classic subscriptions, Classic Schedule Future Runs, or Lightning report subscriptions? (Please edit).
    – David Reed
    Commented Jun 8, 2019 at 0:42
  • Hi,iam using lightning report subscriptions. Commented Jun 10, 2019 at 9:54

3 Answers 3

4

The Classic Schedule Future Runs and the Lightning Subscribe functionality is represented under the hood as CronTrigger and CronJobDetail records with the CronJobDetail.JobType field set to 'A', for Analytics Notification. You can find them in queries from the Developer Console or Workbench via queries like

SELECT CronExpression, OwnerId, CronJobDetail.Name FROM CronTrigger WHERE CronJobDetail.JobType = 'A'

Unfortunately, knowing this doesn't help us very much. These objects provide very little detail about existing report subscriptions. The Report Id, for example, is notable by its absence, and the Name field is just a UUID.

At present, there's no functionality that would allow correlating these records with the Reports subscribed to.

There's only one other route that I'm aware of, which is through the Analytics Notifications endpoint in the Reports and Dashboards REST API. There's newer functionality in that API that allows you to make a GET call that includes

ownerId. [...] Allows users with Manage Analytics Notifications permission to get notifications for another user with the specified ownerId.

or

recordId. [...] Return notifications for a single record. Valid values are: reportId— Unique report ID ...

Note though that this approach

  1. Involves making a lot of callouts - one per user or one per report - and hence requires a session Id.
  2. Requires Manage Analytics Notifications permission.
0
1

I was able to use the "Scheduled Jobs" page to find owners of "Reporting Notification" jobs. Using this information, I was able to call the REST API through cURL and find the report being called. The API also allows for an Edit/Delete as long as you have the "Manage Analytics Notifications" permissions.

Hope this helps someone.

curl --location --request GET 'https://XXXXX.my.salesforce.com/services/data/v51.0/analytics/notifications?source=lightningReportSubscribe&ownerId=XXXXXX' \
--header 'Authorization: Bearer XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'
0

Shameless plug, but I built an app for this and had it listed on the appexchange. If you just need a one-time pull of your subscriptions, it's free (it'll just expire after 7-30 days). https://appexchange.salesforce.com/appxListingDetail?listingId=a0N3A00000FAgN6UAL

The analytics approach David shared is the appropriate solution if you're looking to home-brew something.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .