我如何在Power App垂直画廊中获取每个输入元素,每次获得最后一个值

发布于 2025-02-01 09:16:31 字数 820 浏览 7 评论 0原文

我正在尝试在电源应用程序中创建动态输入组件,为此我使用了垂直画廊,在该垂直画廊中,我有一个水平容器来正确对齐输入,然后我下面有几个输入。我正在尝试使用“ 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,
});

我都会

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

插入这样 的记录。

I am trying to create dynamic input components in the power apps for that I have used Vertical Gallery, and Within that vertical gallery I have a Horizontal container to align the inputs properly, and then I have several inputs under it. I am trying to get the input values from the gallery using "ForAll" loop but I am getting the value of the last Item only.

Below is the structure of the gallery

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

suppose I have 2 rows In my gallery and I have inserted the records like this

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

Every time I try to fetch the record using "ForAll"

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

I Always get 2 record with the values

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

Same Goes for any number of records.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

凹づ凸ル 2025-02-08 09:16:31

考虑到我有一个带有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}));

Considering that I have a gallery with 2 items and each item has a textbox for the user to input some data. Here's how I would have on the button:

// 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}));
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文