Sign in to see the current vote count, add your own vote, or leave a comment.
I have plenty of use cases where being able to get a report's existing definition would be really useful. We can update it via API, but we currently can't retrieve it.
100% agree!! I learned about the update report definitions option this week, and it could be a huge efficiency gain for our project management team. We have several master sheets with forms for things like field reports, meeting minutes, etc., and those are pulled into project-level reports. We now have 10+ reports per project, and every time a project is set up in control center, someone has to go manually update each report with the project number.
Those reports have multiple other filters, grouping, etc., so I must be able to retrieve those definitions first. Otherwise, I would end up overwriting any other filters with the updated project number filter, which would defeat the purpose.
This is actually the most ideal situation. Since you are using Control Center, you already know what the definition is going to be.
The API documentation outlines how it needs to be passed for filters, groupings, etc.. I have already taken advantage of this a few times. Each time I create a test project to fiddle with, but eventually I was able to get it set up so my request body was all set and the project id or name piece of the filter held my dynamic data reference.
https://developers.smartsheet.com/api/smartsheet/openapi/reports/updatereportdefinition
"filters": { "operator": "AND", "criteria": [ { "column": { "title": "Primary Column", "type": "TEXT_NUMBER", "primary": true }, "operator": "EQUAL", "values": [ "{{Run log data reference to pull the dynamic filter piece}}" ] } ] }, "groupingCriteria": [ { "column": { "title": "Primary Column", "type": "TEXT_NUMBER", "primary": true }, "sortingDirection": "ASCENDING", "isExpanded": true } ], "summarizingCriteria": [ { "column": { "title": "Primary Column", "type": "TEXT_NUMBER", "primary": true }, "aggregationType": "COUNT" } ], "sortingCriteria": [ { "column": { "title": "Primary Column", "type": "TEXT_NUMBER", "primary": true }, "sortingDirection": "ASCENDING" } ] }
Multi-level filtering does have a different syntax:
"filters": { "operator": "OR", "nestedCriteria": [ { "operator": "AND", "criteria": [ { "column": { "title": "Price", "type": "TEXT_NUMBER" }, "operator": "GREATER_THAN", "values": ["11"] }, { "column": { "primary": true }, "operator": "CONTAINS", "values": ["PROJ-1"] } ] }, { "operator": "AND", "criteria": [ { "column": { "title": "Quantity", "type": "TEXT_NUMBER" }, "operator": "LESS_THAN", "values": ["12"] }, { "column": { "title": "Sold Out", "type": "CHECKBOX" }, "operator": "IS_CHECKED" } ] } ] }
That's true! I was hoping to make it so that our teams could manage the reports in their template folders, and I could just set up a workflow to find the project folder at setup, retrieve all reports and definitions, and update the project number filter. Kind of a set it and forget it setup. But the same people who might want to make changes/add reports are also motivated to have the project number filters set up automatically, so we can set up a process to keep both updated!
Being able to retrieve the existing definition would certainly be useful for quite a few reasons including this one. It is one thing I have had to make note of in my build notes that if we change anything with the blueprint report then we need to also update the Bridge workflow.
But at least we have more capabilities than we used to!
Sign in to comment or add your vote.