我在一个应用程序的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
发布评论
评论(3)
听起来您将标签设置为
“ varusername”
(带引号)而不是varusername
(无引号)的文本
属性。尝试删除报价。请注意,您需要从标签的“高级”选项卡,而不是“属性”选项卡。It sounds like you have the
Text
property of the label set to"varUserName"
(with quotes) instead ofvarUserName
(without quotes). Try removing the quotes. Note that you need to set this from the "Advanced" tab of the label, NOT the "Properties" tab.将您的变量放入标签的文本属性中。请注意,双引号之间的任何内容均被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.
要获取已登录的用户的属性,请在应用程序的 instart 上放置:
使用powerApps内置用户功能
varuser.email
>,varuser.fullname
和varuser.image
使用Office365users.searchusersv2 connector
.image
。插图:
To get the logged-in user's properties, place the following
OnStart
of the app:Using PowerApps built-in user functionality
varUser.Email
,varUser.FullName
andvarUser.Image
Using the Office365Users.SearchUsersV2 Connector
.Image
.Illustration: