refarentals.blogg.se

Slack workflow google sheet
Slack workflow google sheet












When the workflow builder saves the configuration, the app will receive a view_submission payload, frow which we need to extract the user_id variable name and set is the input to our step. But it would be possible to do a very similar thing to the channel to which the form will be posted, by adding a channel_select input to the configuration modal. In my case, I hardcoded this id to a specific support channel. It's worthy pointing out that the chat.postEphemeral message also needs a channel_id argument. In my case, I want the person that clicked on the workflow shortcut to receive the form, so I select the option "Person who clicked" and then "Save". On Slack, workflow builder, when we add the step to the workflow, we should see this: "text": "Who should be the recipient of the form?" So we send this configuration form: def open_configuration_modal(payload, client): The chat.postEphemeral call needs to receive the user_id of the recipient of the form.

#Slack workflow google sheet how to

Those were not problems for my use case, but it's good to keep that in mind.Ībout the needy greedy, the important part is how to configure the workflow step so your app receives the required arguments for the chat.postEphemeral call upon the execution of the workflow step. The limitations of this solution is that an ephemeral message needs to be sent to a specific channel, and that we are sacrificing the modal UI. This method does not need a trigger_id, therefore can be triggered via a workflow_step_execution event with little trouble. The workaround is sending the form as an ephemeral message with the chat.postEphemeral method. But I want to share the workaround that I used because it might be useful for other people that face the same problem. I never found a solution to do exactly what I wanted.

slack workflow google sheet

  • Use the Workflow Builder's "Send a Form" step before my custom step, and configure my app to get the inputs from that form.
  • slack workflow google sheet

    A way to send a trigger_id with the workflow_step_execute event, or any way to open my modal from a "workflow_step_execute" event.A way to pin app shortcuts to the shortcut menus, so I don't even need to mess with workflow steps.Here are possible solutions to my problem So I need a workaround to be able to open that form.Īlso tried to ditch my custom form, and add the standard "Send a form" step of the Workflow Builder (not ideal), but I couldn't figure out how to configure my app to receive inputs from a previous step. Unfortunately, the "workflow_step_execution" does not have a "trigger_id" that I can use to open my modal form. So, righ now I can add the workflow step to a workflow, and use the workflow to trigger my app with an "workflow_step_execute_event". # Do a basic call to workflows.updateStep "text": "This step requires no configuration.", # Send a basic view with a confirmation message Open_configuration_modal(payload, client)Įlif payload = 'view_submission' and payload.get('workflow_step'):Įlif payload = 'shortcut': # Would be modified to handle the "workflow_step_execute" eventĮlif payload = 'view_submission':ĭef open_configuration_modal(payload, client): # User tries to add/edit the workflow step to a workflow # Invoke the correct method based on the callback id Payload = json.loads(payload)Ĭlient = WebClient(token=get_secret_value(SLACK_TOKEN_SECRET_NAME)) # Payload is URL encoded parameters, parse it SUPPORT_CHANNEL_ID = os.environ.get('SUPPORT_CHANNEL_ID') SLACK_TOKEN_SECRET_NAME = os.environ.get('SLACK_TOKEN_SECRET_NAME')įRESHSERVICE_TOKEN_SECRET_NAME = os.environ.get('FRESHSERVICE_TOKEN_SECRET_NAME')įRESHSERVICE_DOMAIN = os.environ.get('FRESHSERVICE_DOMAIN') I'm doing all that with and empty configuration screen that receives no inputs. When adding the workflow step to a workflow, the app needs to handle a workflow_step_edit interaction, send a configuration view, and then handle that view submission. So, I'm trying to refactor my app to be triggered by a custom workflow step instead of an app shortcut.

    slack workflow google sheet

    According to this page, this is only seems possible for workflow shortcuts, not for app shortcuts. However, it's required that the shortcut be pinned to the top of the shortcuts menu on a specific support channel on slack. The function parses the data sends a POST request to the helpdesk service that creates the ticket Lambda function receives a "view_submission" interaction with the user inputs.The lambda function receives an "shortcut" interaction, and uses the trigger_id to call the views.open method to send the form to the user.The user clicks on the shortcut to open up a form.

    slack workflow google sheet

    I implemented my app using the interactivity and shortcuts feature, API Gateway and Lambda. I made a slack app to submit helpdesk tickets directly from a form on Slack.












    Slack workflow google sheet