如何在powerapps中设置下拉菜单的默认值 [英] How to set the default value of a dropdown in powerapps

查看:271
本文介绍了如何在powerapps中设置下拉菜单的默认值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在 powerapps 中有一个下拉菜单,需要设置默认值

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

我的下拉列表的 Items 属性我将它链接到我的数据源,它是一个 Azure 表.

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

'[dbo].[ColorTable]'

可以看到内容简化如下

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

虽然我有更多的条目.

在我的详细信息编辑屏幕中,我的主数据源中有 ID 值.但是我需要使用此值设置下拉列表的默认值,但是下拉列表使用 ColorName 作为它的值.

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.

如何设置下拉菜单的默认 ID 值,因为它的值是 ColorName 而不是 ID?

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

推荐答案

我有一个可行的解决方法,但如果再次将所选值保存回来,它可能会与保存发生冲突.

I have a workaround that works but in conjunction with saving the selected value back again it can conflict with the saving.

在下拉列表的 Default 属性中,我添加以下代码

In the Default property of the dropdown I add the following code

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

这篇关于如何在powerapps中设置下拉菜单的默认值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆