电源应用:将下拉列表的默认值设置为第二个项目

发布于 2025-01-21 08:00:05 字数 322 浏览 0 评论 0原文

我正在使用Power Apps应用程序中的下拉列表。下拉的默认值是这样定义的:

if(form1.mode = formmode.new,“ - ”,parent.default)

可能的选项为:

  • -
  • person一个
  • 人B
  • 人C

我想将默认值更改为下拉列表中的第二个选项。我该怎么做?我不想进行“人a”,因为列表是动态的并且可以改变。我尝试使用选择,但无法使其工作。

感谢您的帮助!

I'm using a dropdown in my Power Apps app. The default value for the dropdown is defined this way:

If(Form1.Mode = FormMode.New, "-", Parent.Default)

The possible options are:

  • -
  • Person A
  • Person B
  • Person C

I would like to change the default value to the second option in the dropdown list. How would I go about doing that? I don't want to hardcode "Person A", because the list is dynamic and can change. I tried playing with Choices but couldn't get it to work.

Thanks for any help!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

铁憨憨 2025-01-28 08:00:05

首先,您需要从数据源或类似的集合中提供下拉项(我将用于示例的集合,但可以与数据源一起使用):

[App] OnStart : ClearCollect(_options; ["-", "Person A", "Person B", "Person C"])

然后,您设置项目属性:

[Dropdown1] Items : _options

之后,您使用默认值第2个项目的“最后”和“ firstn”的组合:

[Dropdown1] Default : Last(FirstN(_options, 2)).Value

祝你有美好的一天

First, you need to provide the Dropdown items from a datasource or a collection like this (I'll use a collection for the example but will work the same with a datasource) :

[App] OnStart : ClearCollect(_options; ["-", "Person A", "Person B", "Person C"])

Then, you set your Items property :

[Dropdown1] Items : _options

After that, you use a combinaison with "Last" and "FirstN" for the 2th item in default value:

[Dropdown1] Default : Last(FirstN(_options, 2)).Value

Have a good day

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文