【问题标题】:How do I get every Input element within the Power App Vertical gallery, Getting the last value every time如何获取 Power App Vertical 库中的每个 Input 元素,每次都获取最后一个值
【发布时间】:2022-06-21 11:49:46
【问题描述】:

我正在尝试在我使用垂直库的电源应用程序中创建动态输入组件,并且在该垂直库中我有一个水平容器来正确对齐输入,然后我在它下面有几个输入。我正在尝试使用“ForAll”循环从库中获取输入值,但我只获取最后一个项目的值。

下面是画廊的结构

 DynamicComponentsGallery
 ---- HorizontalContainer
 ---- ---- Input1Text
 ---- ---- Input2Date
 ---- ---- Input3Text
 ---- ---- AddNewElementToGalleryButton

假设我的画廊中有 2 行,并且我插入了这样的记录

Test1Rec1         20/08/2022       Test1Rec2
Test2Rec1         12/12/2022       Test2Rec2

每次我尝试使用“ForAll”获取记录时

ForAll(DynamicComponentsGallery.AllItems, {
  input1 : Input1Text.Text,
  input2 : Text(Input2Date.SelectedDate, DateTimeFormat.ShortDate),
  input3 : Input3Text.Text,
});

我总是得到 2 条记录

Test2Rec1         12/12/2022       Test2Rec2
Test2Rec1         12/12/2022       Test2Rec2

任何数量的记录都一样。

【问题讨论】:

    标签: powerapps powerapps-canvas powerapps-formula powerapps-collection


    【解决方案1】:

    考虑到我有一个包含 2 个项目的画廊,每个项目都有一个文本框供用户输入一些数据。这是我在按钮上的样子:

    // clear the collection to avoid accidental clicks on the button
    Clear(ColOutput);
    
    // ForAll loop running on the gallery to collect each textbox response in the collection
    ForAll(Gallery.AllItems, Collect(ColOutput, {TextboxOutputs:TextInput.Text}));
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2014-03-11
      • 2021-09-28
      • 2021-11-02
      • 1970-01-01
      • 2018-12-29
      • 2019-10-19
      • 1970-01-01
      相关资源
      最近更新 更多