英文:
How to set global variable with Power Apps OnStart property
问题
我已创建了一个空白画布应用程序,并希望使用"OnStart"属性的"set"函数来创建产品详细信息,如产品名称、价格、类别、数量、颜色等。请提供有关此的任何信息。
我想在空白画布应用程序中使用"OnStart"属性创建全局变量。
英文:
I have created blank canvas app and I want to create product details like product name, price, category,quantity, color, etc..., by using set function with OnStart property. Please, suggest any information about this.
I want to create global variable with Onstart property in blank canvas app.
答案1
得分: 2
如果您有一组固定的产品,您可以在应用程序的App
对象的OnStart
属性中编写以下函数:
Set (
gvProducts,
Table(
{
ProductName: "产品 1",
Price: 100,
Category: "类别 1",
Quantity: 5,
Color: "红色"
},
{
ProductName: "产品 2",
Price: 200,
Category: "类别 2",
Quantity: 10,
Color: "绿色"
}
)
)
它创建了具有相同属性的多个记录的表格。您可以根据您的需求调整每个属性的数据类型并添加多个记录/对象。
英文:
If you have fixed set of products, you can write function like below in OnStart
property of App
object in your app:
Set (
gvProducts,
Table(
{
ProductName: "Product 1",
Price: 100,
Category: "Category 1",
Quantity: 5,
Color: "Red"
},
{
ProductName: "Product 2",
Price: 200,
Category: "Category 2",
Quantity: 10,
Color: "Green"
}
)
)
It creates table of multiple records with same properties. You can adjust the data type of each property and add multiple records/objects as per your requirements.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论