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

Action Buttons #3737

Open
kevinmartin opened this Issue Nov 7, 2016 · 13 comments

Comments

Projects
None yet
7 participants
@kevinmartin

kevinmartin commented Nov 7, 2016

It would be great if, apart from creating questions, segments, and metrics, if we can create actions.

Use case scenarios:

  1. Assume a system that scores posts and comments based on potential level of spammy-ness that admin has to go ahead and review... A question is created to view Raw Data of all of these posts/comments. Two actions are created: Allow & Deny.
  2. A travel agency with group bookings needs to go ahead and manually set traveler information in hotel/airline. A question is created to view Raw Data of traveler information. Action is created to change status of booking after information has been sent to hotel/airline.

This would be especially great when doing a deep dive on a specific row and its relationships.

Actions would just be queries (usually INSERT or UPDATE) that also accepts variables based on information in the row you're taking action on.

@tlrobinson

This comment has been minimized.

Show comment
Hide comment
@tlrobinson

tlrobinson Nov 7, 2016

Member

Related to #2882

Member

tlrobinson commented Nov 7, 2016

Related to #2882

@kevinmartin

This comment has been minimized.

Show comment
Hide comment
@kevinmartin

kevinmartin Nov 7, 2016

This is slightly different to #2882. Instead of outright editing data in a table (which can be potentially dangerous), the user would only be shown pre-created actions which are very specific.

kevinmartin commented Nov 7, 2016

This is slightly different to #2882. Instead of outright editing data in a table (which can be potentially dangerous), the user would only be shown pre-created actions which are very specific.

@kevinmartin kevinmartin added the Proposal label Nov 7, 2016

@Globegitter

This comment has been minimized.

Show comment
Hide comment
@Globegitter

Globegitter Sep 15, 2017

I think this is a great idea, instead of allowing blank update/edit of everything this would be a much safer appraoch and would allow to have non-technical people run potentially needed update tasks/actions. That would imo make metabase extremely powerful, instead of 'just' being great at analytics (and viewing the underlying data) to also be able to perform very specific crud actions.

Globegitter commented Sep 15, 2017

I think this is a great idea, instead of allowing blank update/edit of everything this would be a much safer appraoch and would allow to have non-technical people run potentially needed update tasks/actions. That would imo make metabase extremely powerful, instead of 'just' being great at analytics (and viewing the underlying data) to also be able to perform very specific crud actions.

@ACPK

This comment has been minimized.

Show comment
Hide comment
@ACPK

ACPK Jan 26, 2018

@Globegitter @kevinmartin @tlrobinson - Would you be interested in pair programming, as I'd love to implement this feature?

ACPK commented Jan 26, 2018

@Globegitter @kevinmartin @tlrobinson - Would you be interested in pair programming, as I'd love to implement this feature?

@jornh

This comment has been minimized.

Show comment
Hide comment
@jornh

jornh Feb 2, 2018

Contributor

I have made a very minimal implementation of something similar. It differs from what’s proposed here by performing a HTTP POST to an API outside Metabase instead of making direct database writes. I think that’s preferable in most cases for a number of reasons (mainly isolation/not having to duplicate business logic).

Currently what I have only works for picking points on line/area/bar visualizations as that fit my current needs, though extending it to cover e.g. table row clicks should be trivial. For my current use I post to an open source tool StreamSets which in a no-code solution validates and picks input and updates my backend.

I’m up for pairing on getting this into the shape of a mergeable PR (with tests etc.) covering more scenarios.

Thoughts?

Contributor

jornh commented Feb 2, 2018

I have made a very minimal implementation of something similar. It differs from what’s proposed here by performing a HTTP POST to an API outside Metabase instead of making direct database writes. I think that’s preferable in most cases for a number of reasons (mainly isolation/not having to duplicate business logic).

Currently what I have only works for picking points on line/area/bar visualizations as that fit my current needs, though extending it to cover e.g. table row clicks should be trivial. For my current use I post to an open source tool StreamSets which in a no-code solution validates and picks input and updates my backend.

I’m up for pairing on getting this into the shape of a mergeable PR (with tests etc.) covering more scenarios.

Thoughts?

@zolrath

This comment has been minimized.

Show comment
Hide comment
@zolrath

zolrath Jun 17, 2018

I would love the ability to define a button for a row that makes allows me to make an HTTP request using data from the given row and potentially some form of authorization header.

Being able to make well defined API requests within Metabase would allow Metabase itself to remain read-only but allow us to define more complex write relationships in our own APIs that we can easily trigger.

zolrath commented Jun 17, 2018

I would love the ability to define a button for a row that makes allows me to make an HTTP request using data from the given row and potentially some form of authorization header.

Being able to make well defined API requests within Metabase would allow Metabase itself to remain read-only but allow us to define more complex write relationships in our own APIs that we can easily trigger.

@joekh

This comment has been minimized.

Show comment
Hide comment
@joekh

joekh Sep 4, 2018

Hey there!
Any idea if this was implemented? (Awesome feature)

joekh commented Sep 4, 2018

Hey there!
Any idea if this was implemented? (Awesome feature)

@jornh

This comment has been minimized.

Show comment
Hide comment
@jornh

jornh Sep 6, 2018

Contributor

@joekh I've implemented what I mentioned above in #3737 (comment) a while back (around v0.27-ish), and it sits on my Metabase fork. Nothing has been merged back to official Metabase. It could be revived.

What's your particular use case? Would something similar to what @zolrath mention above cover what you need as well?

A related issue #8461 to get peoples minds going about requirements/use cases/UX also just popped in ☝️

Contributor

jornh commented Sep 6, 2018

@joekh I've implemented what I mentioned above in #3737 (comment) a while back (around v0.27-ish), and it sits on my Metabase fork. Nothing has been merged back to official Metabase. It could be revived.

What's your particular use case? Would something similar to what @zolrath mention above cover what you need as well?

A related issue #8461 to get peoples minds going about requirements/use cases/UX also just popped in ☝️

@joekh

This comment has been minimized.

Show comment
Hide comment
@joekh

joekh Sep 6, 2018

Hey @jornh, thanks for getting back to me.
My use case is very similar to @zolrath , so in my dashboard I would like to add an action button that can for example execute a post Http request and change a value in a specific table. For example clear the alerts table :). Let me know if this would be possible. Thank you!

joekh commented Sep 6, 2018

Hey @jornh, thanks for getting back to me.
My use case is very similar to @zolrath , so in my dashboard I would like to add an action button that can for example execute a post Http request and change a value in a specific table. For example clear the alerts table :). Let me know if this would be possible. Thank you!

@jornh

This comment has been minimized.

Show comment
Hide comment
@jornh

jornh Sep 7, 2018

Contributor

Thanks for the details @joekh - it sounds doable.

  • 1. As a first step I'll get my current code up to a version 0.30.2 mergeable state.

  • 3. Also, my current implementation only works on Bar/Line/Area graphs. I guess you need it on tables?

  • 2. As mentioned over in #8461 (comment) my current POST Endpoint URL and "Action label" displayed in the menu is hardcoded, so next will be to get that configurable.

  • 4. ... then we'll have to see what other loose ends there are for your use case(s) ...

    • move POST'ing to Backend to not expose tokens etc.

Does that sound like sensible steps? If you see anything obvious missing please chime in.

Contributor

jornh commented Sep 7, 2018

Thanks for the details @joekh - it sounds doable.

  • 1. As a first step I'll get my current code up to a version 0.30.2 mergeable state.

  • 3. Also, my current implementation only works on Bar/Line/Area graphs. I guess you need it on tables?

  • 2. As mentioned over in #8461 (comment) my current POST Endpoint URL and "Action label" displayed in the menu is hardcoded, so next will be to get that configurable.

  • 4. ... then we'll have to see what other loose ends there are for your use case(s) ...

    • move POST'ing to Backend to not expose tokens etc.

Does that sound like sensible steps? If you see anything obvious missing please chime in.

@joekh

This comment has been minimized.

Show comment
Hide comment
@joekh

joekh Sep 7, 2018

Hey @jornh!
Those look like perfect steps. As you mentioned in point (3), the button will be needed on tables too exactly.
I also have a question, in the case of a table, let's say there's a button for each row, do u think when clicking the button u can gather info from that row that you will use in the POST request?
Thank!

joekh commented Sep 7, 2018

Hey @jornh!
Those look like perfect steps. As you mentioned in point (3), the button will be needed on tables too exactly.
I also have a question, in the case of a table, let's say there's a button for each row, do u think when clicking the button u can gather info from that row that you will use in the POST request?
Thank!

@jornh

This comment has been minimized.

Show comment
Hide comment
@jornh

jornh Sep 7, 2018

Contributor

The "button" currently available on the graph is actually just a menu item, like:

Image stolen from #8461 ... hope it can work on tables as well...

Yep, hear you regarding POST'ing the selected object (maybe even selected objects? - can't really remember) as JSON. It's already in there.

Contributor

jornh commented Sep 7, 2018

The "button" currently available on the graph is actually just a menu item, like:

Image stolen from #8461 ... hope it can work on tables as well...

Yep, hear you regarding POST'ing the selected object (maybe even selected objects? - can't really remember) as JSON. It's already in there.

@joekh

This comment has been minimized.

Show comment
Hide comment
@joekh

joekh Sep 7, 2018

Oh ok, I should check it out.

joekh commented Sep 7, 2018

Oh ok, I should check it out.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment