简体   繁体   English

如何在powerapps中设置下拉菜单的默认值

[英]How to set the default value of a dropdown in powerapps

I have a dropdown in powerapps and need to set the default value我在 powerapps 中有一个下拉菜单,需要设置默认值

My Items property of my dropdown I have it linked to my data source which is an Azure table.我的下拉列表的我的Items属性将它链接到我的数据源,它是一个 Azure 表。

'[dbo].[ColorTable]'

One could see the contents simplified as the following人们可以看到内容简化如下

Table({ColorName:"red"; ID: "1"};{ColorName:"green"; ID: "2"}{ColorName:"blue"; ID: "3"})

although I have many more entries.虽然我有更多的条目。

In my details edit screen I have the ID value in my main datasource.在我的详细信息编辑屏幕中,我的主数据源中有 ID 值。 However I need to set the dropdown's default with this value, however the dropdown use the ColorName as it's value.但是我需要使用此值设置下拉列表的默认值,但是下拉列表使用ColorName作为它的值。

How do I set the dropdowns default ID value since its Value is ColorName and not ID ?如何设置下拉默认ID值,因为它的 Value 是ColorName而不是ID

I have a workaround that works but in conjunction with saving the selected value back again it can conflict with the saving.我有一个可行的解决方法,但与再次保存所选值相结合,它可能会与保存发生冲突。

In the Default property of the dropdown I add the following code在下拉列表的Default属性中,我添加以下代码

LookUp('[dbo].[ColorTable]';ID=ThisItem.fk_ColorID;ColorName)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM