Open nikbapat opened 3 years ago
Hi @annguy3n , would it be possible for you to review this PR when you get the chance? Thanks!
IMO, this is a great feature to have, even at my current company, we have been struggling to manually input all the filter conditions every time when someone tries to look up custom metrics from a shared dashboard that has many filters. Based on my understanding of the changes, now all of that can be simplified by using Slack command.
@wilg @annguy3n @namabile @reedloden @ronnieplooker @morganatlooker @arkarkark can you please take a look at this (or help to notify the maintainer that manages this project), really look forward to introduce this feature to my team, thanks!!
@wilg @annguy3n @namabile @reedloden @ronnieplooker @morganatlooker @arkarkark Hi team, any update on this? this is a really nice feature to have, can you please consider, thanks
Before: When calling a dashboard using custom slash commands, lookerbot only allowed for the dashboard to have a single filter. Attempting to call a dashboard with multiple filters and using only one parameter would cause the parameter to be applied to both filters, even if it was only relevant to one. (see below call and resulting applied filters).
Passing multiple parameters to a multi-filter dashboard would pass the literal entered string as a parameter to all filters, even if separated by a space or semicolon.
Using a comma to separate them would lead to a logical "or" between the passed values, which was still applied to all filters. This would create an issue when filters have overlapping input spaces.
After: This PR enables users to pass multiple parameters to the slack command, which will be applied to the filters one by one in the order the filters are listed. The parameters should be separated by semicolons to distinguish between filters. The comma still works as a logical "or" within a given parameter.
If there are fewer parameters passed than available filters, all subsequent filters will have no parameter passed (i.e. no restriction). To leave an earlier parameter blank but pass a value to a later parameter, use a semicolon to separate but do not enter a value.
The PR also makes changes to looker.ts to allow all filters to appear in the help menu in the order that parameters should be entered, with semicolons where appropriate.