Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problem with sf_run_report Error: BAD_REQUEST: Groupings are not supported on a tabular report. #106

Open
2 tasks
JacobNord opened this issue Aug 24, 2021 · 1 comment
Assignees
Labels
enhancement Feature request
Milestone

Comments

@JacobNord
Copy link

Issue submission checklist

When filing your issue please make an attempt to troubleshoot a little bit on your own. If your issue is specifically related to a query, but please consider using the "Query issue template". Also, please consider some of the suggestions below before submitting an issue. Thank you!

  • [ YES] I have set verbose=TRUE function argument if possible.

  • [I DONT THINK THIS IS APPLICABLE] I have tried a few different function call arguments to see if I can workaround and/or isolate the issue (e.g. reviewing the output from the "SOAP" vs "REST" or the "Bulk 1.0" vs "Bulk 2.0" or tinkering with the control argument in the function call).

  • I have taken a look at the unit tests directory ./tests/testthat/ to see if my type of issue has been documented and tested.

  • [NO] I have considered making a minimal reproducible example using the reprex package. Details on how to create a reprex are available here: https://www.tidyverse.org/help/#reprex.

  • I have included the version of R and any packages that are used (Hint: Simply copy/paste the result of devtools::session_info() at the bottom of your issue).

Thank you for considering these steps. It will speed up the process of resolving your issue.


Issue description

A brief description of the problem.

Using sf_run_report, i put in the report id, but i get the error " Error: BAD_REQUEST: Groupings are not supported on a tabular report."

report_id <- "some string"
results <- sf_run_report(report_id)

The report has a grouping value as a column. Are reports like that just not able to be pulled into R by this function?

reprex

# consider inserting a reprex here

Session Info

# consider inserting the output of devtools::session_info() here 
version  R version 4.0.3 (2020-10-10)
 os       Windows 10 x64              
 system   x86_64, mingw32
@StevenMMortimer
Copy link
Owner

@JacobNord Thanks for raising the issue! Yes, only tabular reports are supported at the moment. Since tabular reports don’t have groupings, all of the record level data and summaries are expressed by the T!T key, which refers to the grand total. There is a function parse_report_detail_rows() that you could attempt to modify to work with Summary and Matrix style reports that contain groupings. You will have to read the documentation on which fact map code to target in the report and then parse it.

parse_report_detail_rows <- function(content,

Here is some documentation from the API on how to determine what fact map key you'll want to use to get the results of interest: https://developer.salesforce.com/docs/atlas.en-us.api_analytics.meta/api_analytics/sforce_analytics_rest_api_factmap_example.htm

Side note: I will label this issue as a feature request, because over time I'd love to support Summary and Matrix style reports, I just haven't had the time to implement. If you figure it out, it would be awesome to open a PR and I'll incorporate into the package for others to use. Thanks again!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Feature request
Projects
None yet
Development

No branches or pull requests

2 participants