Power Apps - 筛选组合框

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

我在 Power Apps 中有一个表,其中包含多列位置数据。下面的屏幕截图是 Excel 文件的示例,格式相同。我想要三个组合框(国家、州/省和城市),每个组合框仅显示不同的值,并且选择第一个组合框会过滤下一级的可用选项。

enter image description here

“国家/地区”组合框应仅显示两行 - 美国和加拿大,而不是数据集中的每个条目显示一行。这是正常工作的,这是我在 Items 属性中的代码:

Sort(Distinct('Dim Table Locations', Country),Value,SortOrder.Ascending)

举个例子 - 如果我从国家/地区组合框中选择加拿大,则州/省组合框应分别显示安大略省、艾伯塔省和不列颠哥伦比亚省的一个条目。但是,当我在“国家/地区”组合框中进行选择时,“州/省”组合框为空白。这是我的州/省代码:

Filter(Sort(Distinct('Dim Table Locations', State/Province),Value,SortOrder.Ascending), Value = Combo_Country.Selected.Value)

有人可以帮忙解决这个问题吗?

powerapps powerapps-formula
1个回答
0
投票

组合框 1 项 = SortByColumns(Distinct('Dim Table Locations', Country),Value,SortOrder.Ascending)

组合框 2 项 = SortByColumns(Distinct(Filter('Dim Table Locations',Country=Combobox1.Selected.Value), State),Value,SortOrder.Ascending)

组合框 3 项 = SortByColumns(Distinct(Filter('Dim Table Locations',Country=Combobox1.Selected.Value,State=Combobox2.Selected.Value), City),Value,SortOrder.Ascending)

© www.soinside.com 2019 - 2024. All rights reserved.