我们可以使用应用脚本中的按钮操作将输入文本字段的值从一个功能发送到另一个功能吗?

时间:2019-01-16 07:47:40

标签: google-apps-script

我的一个功能是

 protected override void InputDown(GameObject obj, InputEventData eventData)
    {
        Debug.Log(obj.name + " : InputDown");
        switch (obj.name)
        {
            case BarSceneButton:
                SceneManager.LoadSceneAsync(BarScene, LoadSceneMode.Single);
                break;
            case PieSceneButton:
                SceneManager.LoadSceneAsync(PieScene, LoadSceneMode.Single);
                break;
            case RadarSceneButton:
                SceneManager.LoadSceneAsync(RadarScene, LoadSceneMode.Single);
                break;
            case TorusSceneButton:
                SceneManager.LoadSceneAsync(TorusScene, LoadSceneMode.Single);
                break;
            case BubbleSceneButton:
                SceneManager.LoadSceneAsync(BubbleScene, LoadSceneMode.Single);
                break;
            case TrendGraphSceneButton:
                SceneManager.LoadSceneAsync(TrendChartScene, LoadSceneMode.Single);
                break;
            case DashBoardButton:
                SceneManager.LoadSceneAsync(MainScene, LoadSceneMode.Single);
                break;
            case TwoDBarChartButton:
                SceneManager.LoadSceneAsync(TwoDBarScene, LoadSceneMode.Single);
                break;
            case TwoDPieChartButton:
                SceneManager.LoadSceneAsync(TwoDPieScene, LoadSceneMode.Single);
                break;
            case TwoDGraphChartButton:
                SceneManager.LoadSceneAsync(TwoDGraphScene, LoadSceneMode.Single);
                break;
            case MixedChartSceneButton:
                SceneManager.LoadSceneAsync(MixedChartScene,LoadSceneMode.Single);
                break;
        }
    }

第二个是

function createFormSection(section, inputNames, opt_prefills) {
       var widget = CardService.newTextInput()
      .setFieldName(Txt_home)
      .setTitle(home);
       section.addWidget(widget);
      var action = CardService.newAction().setFunctionName('sendemail');
      var textButton = CardService.newTextButton()
      .setText("Forward")
      .setOnClickAction(action);
      section.addWidget(textButton);
  }

我可以在应用程序脚本的第二个函数中获取文本字段(Txt_home)的值吗?

1 个答案:

答案 0 :(得分:0)

我做到了,实际上很容易。 在第二个功能中使用一行。

var txt_input = event.formInput.txt_home;