Just exploring the reporting API and cant see how to set the user context of the report. For example, if I have a simple tabular report for accounts that are 'My Accounts' the results would be different per user.

Thus, if I try to retrieve report results via the report API from inside a scheduled batch job script the results would be from whose perspective ?

The use case is to try to build something that can extract a set of report results that might span multiple user contexts (and I have no control over the filters those users apply). Any experiences/learnings shared would be most appreciated.


Your results will correspond to whichever user your job is running as, which will be the same as the user who initially schedules the job. If you look under Setup->Jobs->Scheduled Jobs, the user listed as "Submitted By" will be the report's running user.

You'll not be able to run reports "as" other users unless you authenticate to the API as those users. Additionally, session tokens aren't valid permanently, so your scheduled job ultimately will need to adopt a real authentication solution in any case.

  • Thanks David. My final solution seems to be to implement a way for user to actually setup their own schedule with a button click, thus creating the context required. Appreciate the confirmation! Feb 5 '18 at 6:08

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.