title: How to get the slackapi post results back from Flask to slackchannel?
body: <p>I am trying to use /slash command in slack and pass a variable to a function inside the flask route, but somehow if I put all the functions inside the route it doesn't work but If I kept only the return statement it works.
  working condition:</p>
  
  <pre><code>from flask import request
  from netmiko import Netmiko
  from blueprint import blueprint
  from app_data import slackapp
  from slackpyez.ui import BLOCKS
  S1 = {
      "host": "192.168.250.210",
      "username": "admin",
      "password": "admin",
      "device_type": "arista_eos",
      "session_log": "my_session3.txt",
  }
  net_connect = Netmiko(**S1)
  command = "show version"
  output = net_connect.send_command(command, use_textfsm=False)
  @blueprint.route("/ngrok", methods=["POST","GET"])
  def return_show_version():
      return(output)
  </code></pre>
  
  <p>and I can get </p>
  
  <p><a href="https://i.stack.imgur.com/LGOhP.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/LGOhP.jpg" alt="enter image description here"></a></p>
  
  <p>I want to pass a text variable so the ip address would be dynamic but it is not working.</p>
  
  <pre><code>from flask import request
  from netmiko import Netmiko
  from blueprint import blueprint
  from app_data import slackapp
  from slackpyez.ui import BLOCKS
  
  @blueprint.route("/ngrok", methods=["POST","GET","PUT"])
  def return_show_version():
          S1 = {
              "host": request.form["text"],
              "username": "admin",
              "password": "admin",
              "device_type": "arista_eos",
              "session_log": "my_session4.txt",
          }
          net_connect = Netmiko(**S1)
          command = "show version"
          output = net_connect.send_command(command, use_textfsm=False)
          return(output)
  </code></pre>
  
  <p>and here is the result:</p>
  
  <pre><code>ngrok failed with the error "operation_timeout"
  </code></pre>