PowerApps 从另一个下拉框筛选数据

huangapple go评论114阅读模式
英文:

PowerApps combobox filter from another combobox

问题

我屏幕上有多个组合框,它们都使用来自外部 Excel 表格的相同源“Table1”。

当我从“Combobox 1”中选择了一个值后,我希望在其他组合框中不再可以选择它...一直保持这样,直到选择了所有项目。

我对PowerApps非常陌生,这是我的第一个应用程序。我尝试过筛选...

筛选(Table1 <> ComboBox2.Value) 但出现了红色叉号。

如果您能帮我处理这个语法,那将非常棒。

谢谢

Will

英文:

I have a number of combo boxes on a screen and they all use the same source "Table1" from an external excel sheet).

When I have selected a value from "Combobox 1" I would like it not to be available for selection in the other combo boxes... following on and on as items are selected.

I am very new to PowerApps and this is my first app. I have tried to filter...

filter(Table1 <> ComboBox2.Value) but receive the red cross.

If you could help me with the syntax for this that would be great.

Thanks

Will

答案1

得分: 1

Filter(Table1, ThisRecord.Value<> ComboBox1.Selected.Value )

你可以使用上面的函数。

在这里,ComboBox1 是第一个组合框的控件名称。
在第二个组合框的Items属性中,你可以写上面的公式。这个公式用于过滤组合框中选择的值,该值不会显示在第二个组合框中,其他所有值都可见。

要了解更多关于过滤函数的使用信息,请访问以下链接:

http://ashishcoder.com/courses/power-apps/topic-12/filter-function-in-power-apps.html

谢谢。

英文:

Filter(Table1, ThisRecord.Value<> ComboBox1.Selected.Value )

You can use the above function.

Here ComboBox1 is the control name of the First combo box.
On the second Combo Box, on the Items property you can write the above formula. The formula filters the selected value in the combo box and that value is not shown in the second combo box, all other values are visible.

For more info on the use of filter function, visit the following link:

http://ashishcoder.com/courses/power-apps/topic-12/filter-function-in-power-apps.html

Thank you

答案2

得分: 0

以下是翻译好的部分:

"Filter() 是正确的选择,但语法很重要。函数区分大小写。大写的 Filter 会向您显示关于它期望的参数的提示。根据您的公式,这是一个已校正的版本:

Filter(Table1, FieldName <> ComboBox1.Value)

其中 FieldName 是与 ComboBox1 绑定的列的名称。"

英文:

The Filter() is the right choice here, but the syntax is important. Functions are case-sensitive. Filter with capital F would have displayed to you hints about what arguments it expects. Building on your formula, here's a corrected version:

Filter(Table1,FieldName &lt;&gt; ComboBox1.Value)

where FieldName is the name of the column bound in ComboBox1.

答案3

得分: 0

以下是翻译好的部分:

"For this I had to build a collection which is added to by all the combo boxes with a remove when unselected also with the below syntax..."

"为此,我必须构建一个集合,该集合由所有组合框添加,当取消选择时也要移除,还要使用以下语法..."

"RemoveIf(COLLECTIONNAME,Dropdown = 1);"
"Collect(COLLECTIONNAME,{COLUMNNAME FROM COLLECTION:Self.Selected.Team,Dropdown:1});"

"Then the items had to be where not in the collection with the following syntax..."

"然后,项目必须不在集合中,使用以下语法..."

"Filter(Table1, !(COLUMNNAME FROM TABLE 1 in COLLECTIONNAME.COLUMNNAME FROM COLLECTION))"

"Thanks for all the suggestions, hope this helps someone"

"感谢所有的建议,希望这能帮助到某人"

英文:

For this I had to build a collection which is added to by all the combo boxes with a remove when unselected also with the below syntax...

RemoveIf(COLLECTIONNAME,Dropdown = 1);
Collect(COLLECTIONNAME,{COLUMNNAME FROM COLLECTION:Self.Selected.Team,Dropdown:1});

Then the items had to be where not in the collection with the following syntax...

Filter(Table1, !(COLUMNNAME FROM TABLE 1 in COLLECTIONNAME.COLUMNNAME FROM COLLECTION))

Thanks for all the suggestions, hope this helps someone

huangapple
  • 本文由 发表于 2023年6月12日 23:10:54
  • 转载请务必保留本文链接:https://go.coder-hub.com/76458005.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定