Microsoft Power自动开关盒

时间:2020-06-10 07:59:36

标签: switch-statement power-automate

所以我要复制的是以下内容,

   string str = GetInput from Form();

   switch (str)
   {
      case "1":
      case "1 week":
          assign variable = 1
          Insert variable to excel column
          break;
      case "2":
      case "2 weeks":
          assign variable = 3
          Insert variable to excel column
      case "4":
      case "4 weeks":
          assign variable = 4
          Insert variable to excel column
      default:
          assign variable = 0
          Insert variable to excel column
          break;
  }

目前,我的流程类似于下图

Flow

  1. 提交新回复时
  2. 获取回复详细信息
  3. 创建项目动作(使用电源自动运行上述开关条件- 功能)

1 个答案:

答案 0 :(得分:0)

您在流程中使用了Apply for Each控件,相当于普通编程语言中的For循环。您需要使用Switch控件来解决问题,如下图所示。我使用了一个示例字符串参数来显示switch语句的用法,但是如果您的数据来自数组,则可以在Switch循环内应用Apply for Each

Read this article,以获取逐步指导。

enter image description here