将标签的文本属性设置为电源应用中的可变值

发布于 2025-02-08 20:43:56 字数 209 浏览 2 评论 0 原文

我在一个应用程序的Onstart属性中拥有代码,该应用程序存储使用该应用程序的用户的值之类的代码。我想将该变量的值用作标签的文本,但它只是显示了变量的名称,而不是存储在变量中的值。例如,我有一个名为“ varusername”的变量,该变量存储“ chad”。而不是显示“乍得”,而是显示“ vrusername”。我开始手动运行ONSTART,我看到该变量已被初始化,因为它在具有值的功率应用程序列表上

I have code in OnStart property of an App that stores values of the Users that use the App like first name. I want to use the value of that variable as the text of a label but it’s just showing the name of the variable instead of the value that’s stored in the variable. For example, I have a variable named “varUserName” that stores the name “Chad”. Instead of showing “Chad” it shows “varUserName”. I started running Onstart manually and I see that the variable has been initialized because it’s on the Variable list of Power Apps with a value

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

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

发布评论

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

评论(3

扛刀软妹 2025-02-15 20:43:56

听起来您将标签设置为“ varusername” (带引号)而不是 varusername (无引号)的文本属性。尝试删除报价。请注意,您需要从标签的“高级”选项卡,而不是“属性”选项卡。

It sounds like you have the Text property of the label set to "varUserName" (with quotes) instead of varUserName (without quotes). Try removing the quotes. Note that you need to set this from the "Advanced" tab of the label, NOT the "Properties" tab.

南渊 2025-02-15 20:43:56

将您的变量放入标签的文本属性中。请注意,双引号之间的任何内容均被PowerApps确定为文本。要将其识别为变量,请丢失双引号。

此外,我将在OnStart事件中保存用户的整个配置文件。如SET(CurrentUser,myProfile());

这样,我可以使用currentuser.displayname获取名称,currentuser.mail以获取电子邮件,依此类推。

Put your variable in the label's text property. Please note that anything between double quotes is identified as a text by powerapps. To identify it as a variable, lose the double quotes.

Additionally, I would save the entire profile of the user in the onstart event. Like Set(CurrentUser,MyProfile());

This way, I can use the CurrentUser.DisplayName to get the name, CurrentUser.Mail to get the email and so on.

森罗 2025-02-15 20:43:56

要获取已登录的用户的属性,请在应用程序的 instart 上放置:

使用powerApps内置用户功能

Set(varUser, User());
  • 这为您提供 varuser.email >, varuser.fullname varuser.image

使用Office365users.searchusersv2 connector

Set(
    varO365User, 
    Office365Users.SearchUserV2(
        {
            searchTerm: User().FullName
        }
    ).value
)
  • 这为您提供了更多属性,但并未本地提供 .image

插图:

”在此处输入图像描述”

To get the logged-in user's properties, place the following OnStart of the app:

Using PowerApps built-in user functionality

Set(varUser, User());
  • This gives you varUser.Email, varUser.FullName and varUser.Image

Using the Office365Users.SearchUsersV2 Connector

Set(
    varO365User, 
    Office365Users.SearchUserV2(
        {
            searchTerm: User().FullName
        }
    ).value
)
  • This gives you MANY more properties, but does not natively provide .Image.

Illustration:

enter image description here

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