无法在 Power Apps 表单中正确配置依赖字段

问题描述 投票:0回答:1

我在 Power Apps 中创建了一个表单,如下所示: Form can be seen here:

表格应显示在“操作”字段中选择的操作的所有区域。

但是,当前表单仅显示“操作”字段中选择的 1 个操作的区域。当多个操作时,区域字段仅列出与第一个选定操作相关的区域。

我在区域组合框的 Items 属性中使用以下代码

If(
  ddselection.SelectedText.Value = "Zones",
  Switch(
    First(cboperations.SelectedItems).Value,
    "Operation 1", ["O1Z1", "O1Z2", "O1Z3"],
    "Operation 2", ["O2Z1", "O2Z2", "O2Z3", "O2Z4", "O2Z5"],
    "Operation 3", ["O3Z1", "O3Z2", "O3Z3", "O3Z4"],
    []
  ),
  []
)

但是此代码并未显示与操作字段中所选操作相关的所有区域。

powerapps powerapps-canvas powerapps-formula
1个回答
0
投票

您可以尝试类似的操作:

With({
  opTable: Table(
    { op: "Operation 1", zns: "O1Z1|O1Z2|O1Z3" },
    { op: "Operation 2", zns: "O2Z1|O2Z2|O2Z3|O2Z4|O2Z5" },
    { op: "Operation 3", zns: "O3Z1|O3Z2|O3Z3|O3Z4" }
  )
},
  Split(Concat(
    Filter(opTable, op in cboperations.SelectedItems.Value),
     zns, "|"), "|"
  )
)
© www.soinside.com 2019 - 2024. All rights reserved.