How to set the default value of a dropdown in powerapps

好久不见. 提交于 2019-12-24 03:45:27

问题


I have a dropdown in powerapps and need to set the default value

My Items property of my dropdown I have it linked to my data source which is an Azure table.

'[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. However I need to set the dropdown's default with this value, however the dropdown use the ColorName as it's value.

How do I set the dropdowns default ID value since its Value is ColorName and not ID?


回答1:


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

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


来源:https://stackoverflow.com/questions/39490200/how-to-set-the-default-value-of-a-dropdown-in-powerapps

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!