PowerApps中SharePoint表单Lookup字段显示空白问题求助
问题描述
在PowerApps中使用SharePoint表单时,Lookup列「Product」存在异常:查看现有项时,尽管主列表中该字段已有值(如"vEPC"),表单中的Product组合框却显示空白。
配置信息
Product列表与主列表
- 存在
Product List,主列表通过其Title列获取产品名称 - 主列表中存在Product列有值的项,但表单打开后对应字段空白
Product组合框及数据卡片配置
- Product_DataCard1: Control: TypedDataCard Variant: fluentV9ComboBoxEditCard Properties: DataField: ="Product" Default: =ThisItem.Product DisplayName: =DataSourceInfo([@'Hot Issues'],DataSourceInfo.DisplayName,Product) Update: |- ={ Value: ProdCombo.Selected.Title, Id: LookUp( 'Product List', Title = ProdCombo.Selected.Title ).ID } DisplayMode: =Parent.DisplayMode Height: =45 Width: =576 X: =1 Y: =5 Children: - ProdCombo: Control: ComboBox Variant: pcfdataset Properties: AccessibleLabel: =Parent.DisplayName DefaultSelectedItems: |- ={Title: ThisItem.Product.Value} Items: =Filter('Product List', 'Product Family' = ProdFamCombo.Selected.Value) Required: =Parent.Required ValidationState: =If(IsBlank(Parent.Error), "None", "Error") DisplayMode: =Parent.DisplayMode Width: =(Parent.Width - 48) * 0.4 X: =DataCardKey3.X + DataCardKey3.Width Y: =10 Children: - Title2: Control: PowerApps_CoreControls_ComboboxCanvasTemplate_dataField Variant: textualColumn Properties: FieldDisplayName: ="Title" FieldName: ="Title" FieldType: ="s" Order: =1
正常工作的Customer Lookup列配置对比
- Customer_DataCard1: Control: TypedDataCard Variant: fluentV9ComboBoxEditCard Properties: DataField: ="CustomerName" Default: =ThisItem.'Customer Name' DisplayName: =DataSourceInfo([@'Hot Issues'],DataSourceInfo.DisplayName,'CustomerName') Update: |- ={ Value: CustomerCombo.Selected.Title, Id: LookUp( Customers, Title = CustomerCombo.Selected.Title && Country.Value = CountryCombo.Selected.Value ).ID } DisplayMode: =Parent.DisplayMode Children: - CustomerCombo: Control: ComboBox Variant: pcfdataset Properties: AccessibleLabel: =Parent.DisplayName DefaultSelectedItems: |- ={Title: ThisItem.'Customer Name'.Value} InputTextPlaceholder: ="Find customer" Items: =Filter(Customers, Country.Value = CountryCombo.Selected.Value) Required: =Parent.Required ValidationState: =If(IsBlank(Parent.Error), "None", "Error") Width: =(Parent.Width - 48) * 0.4 X: =DataCardKey1.X + DataCardKey1.Width Y: =10 Children: - Title1: Control: PowerApps_CoreControls_ComboboxCanvasTemplate_dataField Variant: textualColumn Properties: FieldDisplayName: ="Title" FieldName: ="Title" FieldType: ="s" Order: =1
问题原因及解决方案
核心原因
DefaultSelectedItems结构不匹配
ProdCombo的Items返回的是Product List的完整记录(包含ID、Title、Product Family等字段),但DefaultSelectedItems仅设置了{Title: ThisItem.Product.Value}——单一字段对象无法与完整记录结构匹配,导致组合框无法识别选中项。联动筛选的前置值未加载
若ProdFamCombo未正确加载当前项对应的Product Family值,Filter('Product List', 'Product Family' = ProdFamCombo.Selected.Value)会返回空列表,Product组合框无选项可显示。
解决方案
- 修正ProdCombo的DefaultSelectedItems
将其改为返回与Items结构一致的完整记录:
// 方案1:通过Lookup列的ID精准匹配 LookUp('Product List', ID = ThisItem.Product.Id) // 方案2:通过Title和Product Family匹配 LookUp('Product List', Title = ThisItem.Product.Value && 'Product Family' = ThisItem.Product.'Product Family'.Value)
- 确保ProdFamCombo默认值正确
设置ProdFamCombo的DefaultSelectedItems为:
ThisItem.Product.'Product Family'
保证打开表单时先加载对应的产品家族,使Product列表的筛选返回有效结果。
- 验证数据卡片Default设置
确认Product_DataCard1的Default为ThisItem.Product,确保数据卡片与数据源的绑定正确。
内容的提问来源于stack exchange,提问作者hellomansour
相关产品推荐
相关产品推荐

